Ejemplo n.º 1
0
async def keyboard_command():
    """Shows how to create reply keyboard"""

    kb = ReplyKeyboard()
    kb.text("😃 Super").row()
    kb.text("🙃 Great").row()
    kb.text("🤨 Not bad").row()
    kb.text("😖 All bad").row()
    kb.text("/cancel")

    await SendMessage(context.user.id,
                      '🔹 How are you feeling?',
                      reply_markup=kb.render()).send()
Ejemplo n.º 2
0
async def keyboard_contact_command():
    """Shows how to create contact button"""

    kb = ReplyKeyboard()
    kb.contact("☎️ Send contact").row()
    kb.text("/cancel")

    await SendMessage(context.user.id,
                      '🔹 Send me your contact.',
                      reply_markup=kb.render()).send()
Ejemplo n.º 3
0
async def keyboard_location_command():
    """Shows how to create location button"""

    kb = ReplyKeyboard()
    kb.location("🗺 Send location").row()
    kb.text("/cancel")

    await SendMessage(context.user.id,
                      '🔹 Send me your location.',
                      reply_markup=kb.render()).send()
Ejemplo n.º 4
0
async def start_command():
    """This is asynchronous handler. You can use here any async code."""
    kb = ReplyKeyboard()
    kb.text("Русский").row()
    kb.text("Uzbek").row()
    SendMessage(
        context2.message.user.user_id,
        'Добро пожаловать в наш бот, пожалуйста выберите язык использования',
        reply_markup=kb.render()).webhook()
    while True:
        yield next_all()

        if context2.message.text == 'Русский':
            kb = ReplyKeyboard()
            kb.text("Главное меню").row()

            SendMessage(context2.message.user.user_id,
                        'Вы выбрали Русский язык.\nДобро пожаловать в бот!',
                        reply_markup=kb.render()).webhook()
            return
        elif context2.message.text == "O'zbek":
            kb = ReplyKeyboard()
            kb.text("Asosiy menu").row()

            SendMessage(context2.message.user.user_id,
                        'O\'zbek tilini tanladingiz.\nBotga hush kelibsiz!',
                        reply_markup=kb.render()).webhook()
            return
        SendMessage(context2.message.user.user_id,
                    'Wrong input, no such one available.').webhook()