Skip to content

Commit 2cbb9e4

Browse files
committed
Fixing Emojis model and updated the README
1 parent 29c1f7e commit 2cbb9e4

File tree

2 files changed

+858
-847
lines changed

2 files changed

+858
-847
lines changed

README.rst

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,37 @@ To fetch images sent to your Bot::
8989
>>> updates = bot.getUpdates()
9090
>>> print [u.message.photo for u in updates if u.message.photo]
9191

92-
To post a text message (you'll always need chat_id to reply users)::
92+
To reply messages you'll always need the chat_id::
9393

9494
>>> chat_id = bot.getUpdates()[-1].message.chat_id
95+
96+
To post a text message::
97+
9598
>>> bot.sendMessage(chat_id=chat_id, text="I'm sorry Dave I'm afraid I can't do that.")
9699

97100
To post an Emoji (special thanks to `Tim Whitlock <http://apps.timwhitlock.info/emoji/tables/unicode>`_)::
98101

99-
>>> chat_id = bot.getUpdates()[-1].message.chat_id
100102
>>> bot.sendMessage(chat_id=chat_id, text=telegram.Emoji.PILE_OF_POO)
101103

102-
To post a audio file (you'll always need chat_id to reply users)::
104+
To post a audio file::
103105

104-
>>> chat_id = bot.getUpdates()[-1].message.chat_id
105106
>>> bot.sendAudio(chat_id=chat_id, audio=open('tests/telegram.ogg', 'rb'))
106107

107108
To tell the user that something is happening on bot's side::
108109

109-
>>> chat_id = bot.getUpdates()[-1].message.chat_id
110110
>>> bot.sendChatAction(chat_id=chat_id, action=telegram.ChatAction.TYPING)
111111

112+
To create `Custom Keyboards <https://core.telegram.org/bots#keyboards>_`::
113+
114+
>>> custom_keyboard = [[ telegram.Emoji.THUMBS_UP_SIGN, telegram.Emoji.THUMBS_DOWN_SIGN ]]
115+
>>> reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard)
116+
>>> bot.sendMessage(chat_id=chat_id, text="Stay here, I'll be back.", reply_markup=reply_markup)
117+
118+
To hide `Custom Keyboards <https://core.telegram.org/bots#keyboards>_`::
119+
120+
>>> reply_markup = telegram.ReplyKeyboardHide()
121+
>>> bot.sendMessage(chat_id=chat_id, text="I'm back.", reply_markup=reply_markup)
122+
112123
There are many more API methods, to read the full API documentation::
113124

114125
$ pydoc telegram.Bot

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy