K
K
Kurodzu2019-12-11 13:18:17
Python
Kurodzu, 2019-12-11 13:18:17

Python, im stupid. Help. alarm. Anyone?

elif call.data == '500' or '750' or '1150' or '1300' or '1500' or '2500' or '2600' or '3450' or '4000':
        kol_keyboard = telebot.types.InlineKeyboardMarkup(row_width=3)
        kol_btn1 = telebot.types.InlineKeyboardButton(text='1', callback_data='1')
        kol_btn2 = telebot.types.InlineKeyboardButton(text='2', callback_data='2')
        kol_btn3 = telebot.types.InlineKeyboardButton(text='3', callback_data='3')
        kol_btn4 = telebot.types.InlineKeyboardButton(text='4', callback_data='4')
        kol_btn5 = telebot.types.InlineKeyboardButton(text='5', callback_data='5')
        kol_btn6 = telebot.types.InlineKeyboardButton(text='6', callback_data='6')
        kol_btn_back = telebot.types.InlineKeyboardButton(text='◀ Назад', callback_data='mm')
        kol_keyboard.add(kol_btn1, kol_btn2, kol_btn3, kol_btn4, kol_btn5, kol_btn6, kol_btn_back)
        #ab = int(call.data)
        #print(ab)
        bot.edit_message_text(chat_id=call.message.chat.id,
                              message_id=call.message.message_id,
                              text='Выберите количество товара:',
                              reply_markup=kol_keyboard)

    elif call.data == '1' or '2' or '3' or '4' or '5' or '6':
        #ba = int(call.message.text)
        #print(ba)
        #abba = ab * ba
        #print(abba)
        opl_keyboard = telebot.types.InlineKeyboardMarkup(row_width=1)
        opl_btn = telebot.types.InlineKeyboardButton(text='Оплатить', url='https://qiwi.com/payment/form/99'
                                                                          '?amountFraction=0&currency=RUB&extra%5B'
                                                                          '%27account%27%5D=7918502****&extra%5B'
                                                                          '%27comment%27%5D=thisiscomment&amountInteger=' + 'ПОЛОВОЙ_(abba)_ЧЛЕН' + ''
                                                                          '&blocked[0]=sum&blocked[ '
                                                                          '1]=account&blocked[2]=comment')
        opl_btn_back = telebot.types.InlineKeyboardButton(text='◀ Назад', callback_data='mm')
        opl_keyboard.add(opl_btn, opl_btn_back)
        bot.edit_message_text(chat_id=call.message.chat.id,
                              message_id=call.message.message_id,
                              text='infa po oplate',
                              reply_markup=opl_keyboard)

Hello to all! I'm a beginner, don't shout or swear or I'll die of panic attacks
Above is the problematic piece of code. As I understand it, I cannot take call.data from one condition and use it in another elif, but this is vital for me in order to twist and turn the link to qiwi as I want. I can't figure out how to implement this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur, 2019-12-11
@ar2rsoft

You need to read about python syntax

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question