Skip to content

Instantly share code, notes, and snippets.

@fatiiates
Last active February 12, 2021 19:53
Show Gist options
  • Save fatiiates/c1ef20790c2d8bcba219caf0c6b7dc97 to your computer and use it in GitHub Desktop.
Save fatiiates/c1ef20790c2d8bcba219caf0c6b7dc97 to your computer and use it in GitHub Desktop.
Medium Telegram Chatbot - Main Method 2nd
def main():
#Telegram Api güncellemelerini yakalayan bir Updater oluşturduk
updater = Updater(TOKEN, use_context=True)
# Api güncellemelerini yönlendirmek için Dispatcher oluşturduk
dp = updater.dispatcher
# Dispatchera komut yakalayıcılarımızı ekledik
dp.add_handler(CommandHandler("start", start))
dp.add_handler(CommandHandler("yardim", help))
dp.add_handler(CommandHandler("hakkinda", about))
# Yanlış bir komut girildiyse burada yakalanacak
dp.add_handler(MessageHandler(Filters.text, wrongCommand))
run(updater)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment