Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot Unresponsive #82

Closed
kwikcoins opened this issue Apr 24, 2023 · 5 comments
Closed

Bot Unresponsive #82

kwikcoins opened this issue Apr 24, 2023 · 5 comments

Comments

@kwikcoins
Copy link

I have installed and configured the config.json with my api key and bot key. I run the bot on terminal and it says the bot has started, but when I try to interact with the bot in telegram it does nothing.

@kwikcoins
Copy link
Author

I have got the bot somewhat working but it seems when it needs to call gpt it doesnt respond. image

@kwikcoins
Copy link
Author

some of my logs

Traceback (most recent call last):
File "/home/codespace/.python/current/lib/python3.10/site-packages/telegram/ext/_application.py", line 1104, in process_update
await coroutine
File "/home/codespace/.python/current/lib/python3.10/site-packages/telegram/ext/_handler.py", line 141, in handle_update
return await self.callback(update, context)
File "/workspaces/codespaces-blank/chatgpt-telegram-bot/src/telegram_message_parser.py", line 121, in chat_text
response = self.message_manager.get_response(
File "/workspaces/codespaces-blank/chatgpt-telegram-bot/src/message_manager.py", line 38, in get_response
self.userDict[id].update(t, message, "user")
File "/workspaces/codespaces-blank/chatgpt-telegram-bot/src/chat_session.py", line 34, in update
if (source == "user") and (contactTime - self.__latestTime > ConfigLoader.get("wait_time")) :
TypeError: '>' not supported between instances of 'float' and 'str'
2023-04-24 06:30:07,229 - TelegramMessageParser - INFO - Get a chat message from user: 1482109310
2023-04-24 06:30:07,635 - telegram.ext._application - ERROR - No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/home/codespace/.python/current/lib/python3.10/site-packages/telegram/ext/_application.py", line 1104, in process_update
await coroutine
File "/home/codespace/.python/current/lib/python3.10/site-packages/telegram/ext/_handler.py", line 141, in handle_update
return await self.callback(update, context)
File "/workspaces/codespaces-blank/chatgpt-telegram-bot/src/telegram_message_parser.py", line 121, in chat_text
response = self.message_manager.get_response(
File "/workspaces/codespaces-blank/chatgpt-telegram-bot/src/message_manager.py", line 38, in get_response
self.userDict[id].update(t, message, "user")
File "/workspaces/codespaces-blank/chatgpt-telegram-bot/src/chat_session.py", line 34, in update
if (source == "user") and (contactTime - self.__latestTime > ConfigLoader.get("wait_time")) :
TypeError: '>' not supported between instances of 'float' and 'str'

@flynnoct
Copy link
Owner

@DSwutang Check this

@DSwutang
Copy link
Collaborator

It seems that the issue is caused by the wait_time field in config.json being filled with a string. We currently do not have an automatic check for config types.
You can modify the relevant part of the config field to the following content:
...
"enable_voice": true,
"wait_time": 600,
"enable_dalle": true,
...
The value filled after wait_time should be an integer or a float, adding quotes may cause it to be identified as a string, which could be the cause of the problem you encountered.

@flynnoct
Copy link
Owner

flynnoct commented May 4, 2023

@DSwutang answer will solve your problem.

@flynnoct flynnoct closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants