Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
- def start(update, context):
- """Send a message when the command /start is issued."""
- context.bot.send_message(chat_id=update.message.chat_id, text="Мне кажется")
- context.bot.send_message(chat_id=update.message.chat_id, text="что мы стали забывать")
- context.bot.send_photo(chat_id=update.message.chat_id, photo=open('1.jpg', 'rb'))
- def help(update, context):
- """Send a message when the command /help is issued."""
- context.bot.send_message(chat_id=update.message.chat_id, text=update.message.text)
- def echo(update, context):
- """Echo the user message."""
- update.message.reply_text(update.message.text)
- def main():
- """Start the bot."""
- updater = Updater(token="TOKEN_HERE", use_context=True)
- dp = updater.dispatcher
- dp.add_handler(CommandHandler("yarik_blayt", start))
- dp.add_handler(CommandHandler("help", help))
- dp.add_handler(MessageHandler(Filters.text, echo))
- updater.start_polling()
- updater.idle()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement