sneaksnake / z5bot

Quite stable interactive fiction bot for Telegram.
MIT License
5 stars 5 forks source link

Network Error When starting a game #6

Open 8bitgentleman opened 7 years ago

8bitgentleman commented 7 years ago

This looks like a really cool project and I just started to set it up. I've got the bot running on a raspberry pi. When I try to start a game in telegram it responds

Starting "Zork 1"... Your progress will be saved automatically.

and then in the RPi terminal throws an error

telegram.ext.dispatcher-WARNING "Error was raised while processing Update. main-WARNING Update <telegram.update.Update object at 0xb64f2230> caused error NetworkError()! Bad Request: message text is empty(400)

Nothing else much happens after that. Any ideas? I'd love to get this running.

Also there seems to be a syntax error here in dfrotz.py? At least that's what the terminal was spitting out

sneaksnake commented 6 years ago

Tried running it with python3 instead of python (which often defaults to two)? AFAIK, at least the syntax of this commit should be error-free. Also, it's a long time ago that I made this; I should probably rewrite it.

8bitgentleman commented 6 years ago

First off thanks for responding! This project was worked on so long ago that it's great to hear from the developer. I ran bot.py with python3 like you suggested but unfortunately I get the same errors. Any other suggestions?

sneaksnake commented 6 years ago

It may simply be that the Telegram devs changed something in the API :/ I have no clue, honestly.

But fyi, I'm currently working on a Go version which will (hopefully) continue being updated. And it works!

sneaksnake commented 6 years ago

@8bitgentleman, I decided to maintain this version until there is more time for a complete rewrite. I've updated the code to be compatible with the newest python-telegram-bot package. Regarding your original issue: do you have some files inside your stories folder and mentioned them in config.json?

8bitgentleman commented 6 years ago

I have both zork_1-r52.z5 and hhgg.z5 in my stories folder. The only thing that I've changed in the config file was my API key. I saw that you had some new commits, should I test it out or are you still making changes?

sneaksnake commented 6 years ago

Feel free to test it.

8bitgentleman commented 6 years ago

After running bot.py with python3 I immediately get this error

[2017-12-26 16:03:57-root-INFO]
Logging in with api key 'MY-API '.
[2017-12-26 16:03:57-root-DEBUG]
Created new Z5Bot instance!
Traceback (most recent call last):
  File "bot.py", line 193, in <module>
    dispatcher.add_handler(telegram.ext.MessageHandler(filters=[], callback=on_message))
AttributeError: 'Dispatcher' object has no attribute 'add_handler'`

I have all the correct packages installed as per requirements.txt.