Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
a simple python telegram bot for fandogh
from telegram.ext import Updater, MessageHandler, Filters
# Telegram API
updater = Updater(token='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
dispatcher = updater.dispatcher
def gpt(bot, update):
bot.sendMessage(
chat_id=update.message.chat_id,
text='Hi, I am on the Fandogh.cloud'
)
def main():
# handle dispatcher
dispatcher.add_handler(MessageHandler(Filters.text, gpt))
# run
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.