Comments (16)
Boom, that was it and it’s up and running like a charm. Thank you, sir.
Really also appreciate that your code has the routine to clear the conversation after x seconds so I can always start fresh instead of manually clearing it.
from chatgpt-telegram-bot.
@dtimekeeper Thanks for your suggestions.
Would you mind copy and paste these suggestions to a new issue that I can easily work with? I will have a conversation with you there. Thanks.
from chatgpt-telegram-bot.
@peteisacat Consider follow the instructions above. This may help you solve the problem.
@flynnoct Thank you very much. I have successfully run it according to the method you described above. Thank you for your hard work.😄❤️
from chatgpt-telegram-bot.
Can you get a reply message when you send "/start" command to your bot?
from chatgpt-telegram-bot.
Hmm, same issue here, sending /start shows 2 tick marks in Telegram for read but no reply, and the bot shows as started without any errors. Is there a debug log maybe?
from chatgpt-telegram-bot.
Can you get a reply message when you send "/start" command to your bot?
No matter what message I send, my robot won't respond with any content。
from chatgpt-telegram-bot.
Hmm, same issue here, sending /start shows 2 tick marks in Telegram for read but no reply, and the bot shows as started without any errors. Is there a debug log maybe?
Sorry, we didn't have a good logging for now :(, I promise we will do this in a few days.
Would you mind following these introductions:
cd
to the work directory, it's<somewhere>/chatgpt-telegram-bot
- execute
python3 telegram_message_parser.py
- try to send a message to your bot and check if there is any traceback prompt in your terminal.
Apologize for not having good outputs and loggings again.
@dtimekeeper @peteisacat
from chatgpt-telegram-bot.
No worries - thank you for your response. I’ve ran the telegram_message_parser.py with the output below:
aaron@artemis:~/chatgpt-dalle-telegram$ python3 telegram_message_parser.py
Traceback (most recent call last):
File "/home/aaron/chatgpt-dalle-telegram/telegram_message_parser.py", line 21, in <module>
config_dict = json.load(f)
File "/home/aaron/anaconda3/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/home/aaron/anaconda3/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/aaron/anaconda3/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/aaron/anaconda3/lib/python3.9/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 4 column 29 (char 184)
(base) aaron@artemis:~/chatgpt-dalle-telegram$
Please let me know if there’s anything else I can provide.
from chatgpt-telegram-bot.
@dtimekeeper Looks like a config file error. Would you mind paste your config.json
contents below?
DO Make sure to hide both of your openai_api_key
and telegram_bot_token
, just replace them with placeholders.
from chatgpt-telegram-bot.
Sure thing:
{
����"openai_api_key": "xxx",
����"telegram_bot_token": "xxx",
����"enable_voice": true, // When enabled, Bot will accept audio messages with Whisper and reply.
����"allowed_users": [
��������"xxx",
����],
����"wait_time": 600, // The time limit in seconds that the Bot will clear the conversation context.
����"enable_dalle": true, // When enabled, Bot will involve DALL·E to handle requests for painting.
����"super_users": [
��������"xxx", // Super users are granted unlimited usage on DALL·E per day.
����],
����"image_generation_limit_per_day": 5 // The upper limit that a normal user is allowed to invoke DALL·E per day.
}
from chatgpt-telegram-bot.
I think the problem could come from invalid comments in the JSON file.
Try removing all comments in your config.json file which means removing all // some comments
and start again. I think it should work.
We actually should comment the keys in a better way. We will fix that in next version. Thanks.
from chatgpt-telegram-bot.
I believe I’ve cleaned out the comments but still get the error - at least it’s a different line now? :):
(base) aaron@artemis:~/chatgpt-dalle-telegram$ python3 telegram_message_parser.py
Traceback (most recent call last):
File "/home/aaron/chatgpt-dalle-telegram/telegram_message_parser.py", line 21, in <module>
config_dict = json.load(f)
File "/home/aaron/anaconda3/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/home/aaron/anaconda3/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/aaron/anaconda3/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/aaron/anaconda3/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 7 column 5 (char 228)
(base) aaron@artemis:~/chatgpt-dalle-telegram$
{
����"openai_api_key": "xxx",
����"telegram_bot_token": "xxx",
����"enable_voice": true,
����"allowed_users": [
��������"xxx",
����],
����"wait_time": 600,
����"enable_dalle": true,
����"super_users": [
��������"xxx",
����],
����"image_generation_limit_per_day": 5
}
The Telegram bot key has some funky letters like ___ and : so maybe it might be that?
from chatgpt-telegram-bot.
@dtimekeeper Both allowed_users
and super_users
are JSON lists. Elements inside should be split with commas(,), however, no comma needed after last element.
So try removing commas in line 6 and line 11.
from chatgpt-telegram-bot.
@dtimekeeper A robust program should work in this way. Glad you like it.
If there's more advices or suggestions please let me know.
from chatgpt-telegram-bot.
@peteisacat Consider follow the instructions above. This may help you solve the problem.
from chatgpt-telegram-bot.
@dtimekeeper A robust program should work in this way. Glad you like it.
If there's more advices or suggestions please let me know.
It really should, but neither of the 3-4 other python options I tried had that.
Suggestions wise, one of use cases is basically running another instance for my friends to use as a telegram bot. It would be helpful to have a way to ‘whitelist’ all telegram IDs so as long as they know the link to message it, they can talk to the bot.
Related to this too, but not sure how feasible it is, would be separate conversational context for each person that messages the bot, but I’m also not sure if this is even possible with the API.
Thanks again.
from chatgpt-telegram-bot.
Related Issues (20)
- Add TTS feature to reply voice messages with Amazon Polly HOT 6
- Add logging config
- Add logging config
- Please Make Deployable On Replit HOT 1
- how to use voice?
- how to use inline mode? HOT 2
- Settings HOT 2
- Add the ability to change the role please HOT 1
- •́ ‿ ,•̀
- how to get working HOT 6
- v1.2.2 to v1.3.0. Backward compatibility HOT 3
- Azure TTS, Enhanced Logging and Better Structured Config HOT 1
- Bot Unresponsive HOT 5
- Update readme to v1.4.0
- Handle messages concurrently
- Single Message Mode
- How to run a bot so that it responds with an audio message?
- Could I get the bot work with Azure OpenAI Service by any chance?
- Oops, something went wrong with OpenAI. Please try again later.
- Add continue_chat command
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-telegram-bot.