Files
Agampreet Singh 4d38f0b362 Add python-telegram-bot (#226)
* Add python-telegram-bot

Update

Update bot.py

* Update bot.py

* Update requirements.txt
2022-02-16 20:23:01 -08:00

16 lines
501 B
Python

from telegram import Update
from telegram.ext import Updater, CommandHandler, CallbackContext
import os
def start(update: Update, context: CallbackContext) -> None:
update.message.reply_text(f'Hello {update.effective_user.first_name}\nI am a sample Telegram bot made with python-telegram-bot!')
updater = Updater(os.environ.get("TOKEN"), use_context=True)
updater.dispatcher.add_handler(CommandHandler('start', start))
print("Bot started successfully")
updater.start_polling()
updater.idle()