bot.py · python-telegram-bot/python-telegram-bot · Discussion #5069 · GitHub
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
-
Heading
-
Bold
-
Italic
-
Quote
-
Code
-
Link
-
Numbered list
-
Unordered list
-
Task list
-
Attach files
-
Mention
-
Reference
👍
1
reacted with thumbs up emoji
👎
1
reacted with thumbs down emoji
😄
1
reacted with laugh emoji
🎉
1
reacted with hooray emoji
😕
1
reacted with confused emoji
❤️
1
reacted with heart emoji
🚀
1
reacted with rocket emoji
👀
1
reacted with eyes emoji
Footer
You can’t perform that action at this time.
Uh oh!
There was an error while loading. Please reload this page.
{{title}}
Uh oh!
There was an error while loading. Please reload this page.
-
from telegram.ext import (
Updater, CommandHandler, MessageHandler,
Filters, ConversationHandler
)
from telegram import ReplyKeyboardMarkup
import os
TOKEN = os.getenv("BOT_TOKEN")
ADMIN_ID = int(os.getenv("ADMIN_ID"))
DESIGN, TIME, CONTACT = range(3)
def start(update, context):
keyboard = [
["🎨 Xizmatlar", "💼 Portfolio"],
["📝 Buyurtma berish", "📞 Aloqa"]
]
reply_markup = ReplyKeyboardMarkup(keyboard, resize_keyboard=True)
def menu(update, context):
text = update.message.text
def order_start(update, context):
update.message.reply_text("Qanday dizayn kerak?")
return DESIGN
def get_design(update, context):
context.user_data["design"] = update.message.text
update.message.reply_text("Qachon tayyor bo‘lishi kerak?")
return TIME
def get_time(update, context):
context.user_data["time"] = update.message.text
update.message.reply_text("Aloqa uchun username yoki raqam:")
return CONTACT
def get_contact(update, context):
context.user_data["contact"] = update.message.text
def main():
updater = Updater(TOKEN)
dp = updater.dispatcher
if name == "main":
main()
Beta Was this translation helpful? Give feedback.