Untitled
unknown
plain_text
a year ago
1.7 kB
10
Indexable
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
# Define a function to handle the /start command
def start(update, context):
update.message.reply_text('سلام! به ربات تلگرامی خوش آمدید.')
update.message.reply_text('برای ساخت سلف دستور /create را استفاده کنید')
# Define a function to handle the /create command
def create(update, context):
update.message.reply_text('حالا شماره خود را ارسال کنید')
# Define a function to handle the user's response
def receive_number(update, context):
update.message.reply_text('کد ارسال شده را با فرمت 1 2 3 4 5 وارد کنید')
# Define a function to handle the user's response
def receive_code(update, context):
update.message.reply_text('رمز دوم اکانت خود را وارد کنید')
# Define a function to handle the /stop command
def stop(update, context):
update.message.reply_text('خداحافظی!')
def main():
# Create the Updater and pass it your bot's token.
updater = Updater("6928361973:AAHUQLMmFsq7TeFFmffGPbAspdhOn1JCts4", use_context=True)
# Get the dispatcher to register handlers
dp = updater.dispatcher
# Define handlers
dp.add_handler(CommandHandler("start", start))
dp.add_handler(CommandHandler("create", create))
dp.add_handler(MessageHandler(Filters.text & ~Filters.command, receive_number))
dp.add_handler(MessageHandler(Filters.text & ~Filters.command, receive_code))
dp.add_handler(CommandHandler("stop", stop))
# Start the Bot
updater.start_polling()
# Run the bot until you press Ctrl-C
updater.idle()
if __name__ == '__main__':
main()
Editor is loading...
Leave a Comment