SouravJohar / gangsta

Gotta speak gangsta? This bot will hook you up.
37 stars 64 forks source link

Bot is not replying #4

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello bro, I watched the tutorial and write the ditto code, even copied yours, but the bot is able to read the messages but not able to reply. Kindly help

Klimmbimmel commented 3 years ago

Please be more precise with your question. What did you do? What part of the code did you change?

helenmar commented 3 years ago

I watched the video and used the code exactly, I didn't change anything. When I ran the server.py code I got an error ... Traceback (most recent call last): File "server.py", line 15, in updates = updates["result"] TypeError: 'NoneType' object is not subscriptable i delete my file tree from the file part

tuyyui commented 3 years ago

I watched the video and used the code exactly, I didn't change anything. When I ran the server.py code I got an error ... Traceback (most recent call last): File "server.py", line 15, in updates = updates["result"] TypeError: 'NoneType' object is not subscriptable i delete my file tree from the file part

I'm getting this same error anyone knows why?

tuyyui commented 3 years ago

It wasn't the authorization token it was an error within my PyCharm setting. Please make sure you have a cfg extension installed so your PyCharm IDE will read the file.

Klimmbimmel commented 3 years ago

Following the error, this could also be related to a broken telegram response. Updates will look very empty in case of server errors. It can be empty, updates["ok"] can be False. (I have never seen ok or result not being in updates, although i check for those errors.)

Also, one user deleted their reply, but it was correct also. The line 24 in server.py

from_ = item["message"]["from"]["id"]

can break also, as ["message"]["from"] is optional. (It might be empty in redirected messages)