Home>

Description of the problem in Python code

In general, I develop a bottle telegrams using the Telebot module and for my bot need the InLine buttons, the reading documentation has learned to create 2 types inline and reply and created a script

Error

Error lies in creating the following function of my script where inlineKeyboardButton is used again by changing the Markup7= TELEBOTTON variable I thought that the function would work but no error

Error
2021-04-07 20: 54: 23,638 (__init__.py:55 MainThread) Error -Telebot: "A Request To The Telegram API
Was unsuccessful. Error Code: 400. Description: Bad Request: Message Text IS Empty "

Python code

First function (Keybord)

@ Bot.Message_Handler (Commands= ['Command'])
Def Start_Messages (Message):
   Markup9= Types.ReplyKeyboardMarkup (One_Time_Keyboard= True, Resize_Keyboard= True)
   Markup9.Add ('Button', 'Button1')
   Markup= TELEBOT.Types.inlineKeyboardMarkUp ()
   Markup.add (Telebot.Types.inlineKeyboardButton (Text= 'Button', callback_data= 'button'))
   M= Bot.Send_Sticker (Message.chat.id, 'caacagiaaxkbaaebbcjgwkqrpsebvy0iotcdeylcbm8jraacfwado2akfcfdm7q_uejchgq',
                     Reply_Markup= Markup9)
   Bot.Send_Message (message.chot.id, text= "Choose the Genre API ????", Reply_MarkUp= Markup,)
   Bot.register_next_Step_Handler (M, Process_Step9)
DEF Process_Step9 (Message):
   Chat_id= Message.Chat.ID.
   If Message.Text== 'Button':
    START_MESSAGES (Message)
   ELIF Message.Text== 'Button1':
    Help_Message (Message)
@ Bot.callback_Query_Handler (Func= Lambda Call: True)
   Def Query_Handler (Call):
      Bot.answer_callback_Query (callback_query_id= call.id, text= 'Text')
      Answer= ''
     If Call.data== 'Button':
        Answer= (Random.Choice (List0) + "Text") # list in full code is
     Bot.Send_Message (call.message.chat.ID, Answer)

Second function (Keybord)

@ Bot.Message_Handler (Commands= ['Command1'])
  DEF START_MESSAGES1 (Message):
     Markup8= Types.ReplyKeyboardMarkup (one_time_keyboard= True, Resize_Keyboard= True)
     Markup8.add ('' Button ',' Button ')
     Markup7= TELEBOT.Types.inlineKeyboardMarkUp ()
     Markup7.add (Telebot.Types.inlineKeyboardButton (Text= 'Button', callback_data= 'button3'))
     Markup7.add (Telebot.Types.inlineKeyboardButton (Text= 'Button', callback_data= 'button4'))
     BM= Bot.send_Sticker (Message.chat.id, 'caacagiaaxkbaaebbcjgwkqrpsebvy0iotcdeylcbm8jraacfwado2akfcfdm7q_uejchgq'
                      Reply_MarkUp= Markup7)
    Bot.Send_Message (Message.chat.ID, Text= None, Reply_MarkUp= Markup8)
    Bot.register_next_STEP_Handler (BM, Process_Step7)
Def Process_Step7 (Message):
   Chat_id= Message.Chat.ID.
   If Message.Text== 'Button':
    START_MESSAGES (Message)
   ELIF Message.Text== 'Button':
    Help_Message (Message)
@ Bot.callback_Query_Handler (Func= Lambda Call1: True)
   Def Query_Handler1 (Call):
      Bot.answer_Callback_Query (callback_query_id= call.id, text= 'Thank you for choosing!')
      Answer= ''
      if call.data== 'button3':
        Answer0= "Test"
      Elif call.data== 'Button4':
        ANSWER= "TEST"
    Bot.Send_Message (call.message.chat.ID, Answer)

Conclusion

I have already seen my mistakes I ask you to specify them to write the code of the second function without any problems I will be very grateful for your help!

Maybe he does not like Text= None.

GrAnd2021-04-07 20:16:59