How to Create and Code a Telegram bot on your phone! #python #coding #bots #software

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

mobile per powerful telegram bot kaise banaen aur python code ko Pydorid 3 per ran kaise karen Mera ran nahin ho raha hai .Maine chat gpt se code likhaya tha . Please explain step by step.

sadmusics
Автор

Code:

from telegram.ext import Updater, MessageHandler, Filters


#this function reply to user
def reply(update, text):



def handle_text_message(update, context):
text = update.message.text
#user message is stored in text

if "hi" in text:
reply(update, "hello")

#add more conditions as u need


updater = Updater(token='add your token ', use_context=True)


dp = updater.dispatcher


text_handler = MessageHandler(Filters.text & ~Filters.command, handle_text_message)


dp.add_handler(text_handler)


updater.start_polling()


updater.idle()

Traverser_
welcome to shbcf.ru