Last active
February 12, 2021 19:53
-
-
Save fatiiates/c1ef20790c2d8bcba219caf0c6b7dc97 to your computer and use it in GitHub Desktop.
Medium Telegram Chatbot - Main Method 2nd
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
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