mirror of
https://github.com/SrIzan10/starters.git
synced 2026-05-01 11:05:16 +00:00
16 lines
501 B
Python
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()
|