mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2026-01-10 16:35:43 +01:00
added debug mode as optional configuration
This commit is contained in:
@@ -45,9 +45,11 @@ TELEGRAM_BOT_TOKEN="<YOUR_TELEGRAM_BOT_TOKEN>"
|
||||
|
||||
Additional optional (but recommended) configuration values:
|
||||
```
|
||||
ALLOWED_TELEGRAM_USER_IDS="<USER_ID_1>,<USER_ID_2>,..."
|
||||
ALLOWED_TELEGRAM_USER_IDS="<USER_ID_1>,<USER_ID_2>,..." # Defaults to "*"
|
||||
DEBUG=false # Defaults to TRUE, set to FALSE to disable debug mode
|
||||
```
|
||||
* `ALLOWED_TELEGRAM_USER_IDS`: A comma-separated list of Telegram user IDs that are allowed to interact with the bot (use [getidsbot](https://t.me/getidsbot) to find your user ID). **Important**: by default, *everyone* is allowed (`*`)
|
||||
* `DEBUG`: Enable debug logging for the [revChatGpt](https://github.com/acheong08/ChatGPT) package
|
||||
|
||||
### Run
|
||||
Use the following command to start the bot:
|
||||
|
||||
3
main.py
3
main.py
@@ -26,8 +26,9 @@ def main():
|
||||
'token': os.environ['TELEGRAM_BOT_TOKEN'],
|
||||
'allowed_user_ids': os.environ.get('ALLOWED_TELEGRAM_USER_IDS', '*')
|
||||
}
|
||||
debug = os.environ.get('DEBUG', 'true').lower() == 'true'
|
||||
|
||||
gpt3_bot = ChatGPT3Bot(config=chatgpt_config, debug=True)
|
||||
gpt3_bot = ChatGPT3Bot(config=chatgpt_config, debug=debug)
|
||||
telegram_bot = ChatGPT3TelegramBot(config=telegram_config, gpt3_bot=gpt3_bot)
|
||||
telegram_bot.run()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user