Created
August 19, 2015 09:42
-
-
Save hoseinmontazer/60987cf96ab27b0b6d00 to your computer and use it in GitHub Desktop.
test-python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import telegram | |
bot = telegram.Bot(token='94659039:AAGxm7YBCKonO9DYtusYWBnbG1Ve8BjK3iM') | |
print bot.getMe() | |
updates = bot.getUpdates() | |
print [u.message.text for u in updates] | |
updates = bot.getUpdates() | |
print [u.message.photo for u in updates if u.message.photo] | |
chat_id = bot.getUpdates()[-1].message.chat_id | |
bot.sendMessage(chat_id=chat_id, text="I'm sorry Dave I'm afraid I can't do that.") | |
bot.sendMessage(chat_id=chat_id, text=telegram.Emoji.PILE_OF_POO) | |
bot.sendPhoto(chat_id=chat_id, photo='https://telegram.org/img/t_logo.png') | |
bot.sendVoice(chat_id=chat_id, voice=open('tests/telegram.ogg', 'rb')) | |
bot.sendChatAction(chat_id=chat_id, action=telegram.ChatAction.TYPING) | |
custom_keyboard = [[ telegram.Emoji.THUMBS_UP_SIGN, telegram.Emoji.THUMBS_DOWN_SIGN ]] | |
reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard) | |
bot.sendMessage(chat_id=chat_id, text="Stay here, I'll be back.", reply_markup=reply_markup) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
قسمت voice رو کامنت کن
وقتی هم که بات مسیج نداشته باشه نمی تونه −۱ رو فچ کنه