Skip to content

PyPI out of date | echobot2 example not working with PyPI version #418

@sixhobbits

Description

@sixhobbits

After installing python-telegram-bot through pip, the example code doesn't run. Specifically, the examples now use

update.message.reply_text('Hi!')

to send messages, while the version in PyPI still needs

bot.sendMessage(update.message.chat_id, text='Hi!')

I suggest that

  1. the PyPI package should be updated to reflect the latest version of this library
  2. instructions for installing from source should be added to README.md

Steps to reproduce

  1. pip install python-telegram-bot
  2. create echobot2 and insert code from examples folder
  3. python echobot2.py
  4. send message to bot

Expected behaviour

echobot should reply with same message

Actual behaviour

echo bot throws error

(test) nsbot@nstravel:~/git/NSGroupTickets/NSBot$ python echobot2.py
2016-09-23 14:56:00,713 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while processing the update
Traceback (most recent call last):
  File "/home/nsbot/VEs/test/lib/python3.5/site-packages/telegram/ext/dispatcher.py", line 203, in process_update
    handler.handle_update(update, self)
  File "/home/nsbot/VEs/test/lib/python3.5/site-packages/telegram/ext/messagehandler.py", line 139, in handle_update
    return self.callback(dispatcher.bot, update, **optional_args)
  File "echobot2.py", line 41, in echo
    update.message.reply_text(update.message.text)
AttributeError: 'Message' object has no attribute 'reply_text'

Configuration

Ubuntu 16.04

Version of Python, python-telegram-bot & dependencies:

$ python -m telegram

(test) nsbot@nstravel:~/git/NSGroupTickets/NSBot$ python -m telegram
python-telegram-bot 5.0.0
urllib3 1.17
certifi 2016.08.31
future 0.15.2
Python 3.5.2 (default, Sep 10 2016, 08:21:44)  [GCC 5.4.0 20160609]

Logs

Insert logs here (if necessary)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions