Merge pull request #169 from trollknurr/little-readme-extend

Little document extend
This commit is contained in:
Leandro Toledo 2016-02-01 21:22:35 -02:00
commit 3e7dc705db

View file

@ -34,7 +34,7 @@ A Python wrapper around the Telegram Bot API.
.. image:: https://coveralls.io/repos/python-telegram-bot/python-telegram-bot/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/python-telegram-bot/python-telegram-bot?branch=master
:alt: Coveralls
.. image:: https://img.shields.io/badge/Telegram-Group-blue.svg
:target: https://telegram.me/joinchat/ALnA-AJQm5R7Km9hdCgyng
:alt: Telegram Group
@ -58,9 +58,9 @@ Table of contents
- `Getting started`_
1. `The Updater class`_
2. `API`_
3. `JobQueue`_
4. `Logging`_
@ -190,7 +190,7 @@ Now, we need to define a function that should process a specific type of update:
We want this function to be called on a Telegram message that contains the ``/start`` command, so we need to register it in the dispatcher::
>>> dispatcher.addTelegramCommandHandler('start', start)
The last step is to tell the ``Updater`` to start working::
>>> updater.start_polling()
@ -216,7 +216,7 @@ Let's add some functionality to our bot. We want to add the ``/caps`` command, t
>>> def caps(bot, update, args):
... text_caps = ' '.join(args).upper()
... bot.sendMessage(chat_id=update.message.chat_id, text=text_caps)
...
...
>>> dispatcher.addTelegramCommandHandler('caps', caps)
Now it's time to stop the bot::
@ -283,6 +283,10 @@ To post an image file via URL::
>>> bot.sendPhoto(chat_id=chat_id, photo='https://telegram.org/img/t_logo.png')
To post an image file from disk::
>>> bot.sendPhoto(chat_id=chat_id, photo=open('tests/test.png', 'rb'))
To post a voice file from disk::
>>> bot.sendVoice(chat_id=chat_id, voice=open('tests/telegram.ogg', 'rb'))