How to make a call to send_message with no posts?

Use the library pytelegrambotapi, please refrain from shouting about what this library is shit.
There is such here a script.

@bot.message_handler(commands=['start'])
def start_message(message):
 msg = bot.send_message(message.from_user.id, 'Bot successfully started')
 bot.register_next_step_handler(msg, select_main)

def select_main(message):
 # Send_message problem
 bot.send_message(message.from_user.id, 'Menu features', reply_markup=keyboard['main'])
 if message.text == 'Section 1':
 bot.send_message(message.chat.id f Open [{message.text}]')
 bot.register_next_step_handler(msg, select_content)


Problem: after pressing start you have to send another message to call "problem send_message"
The first message is necessary(of course it will be changed)
Thanks in advance.
April 4th 20 at 00:38
2 answers
April 4th 20 at 00:40
Why are you here at all register_next_step_handler if this is its essence. Remove it and everything.
And how to make the transition to select_main? - keith_Stoltenberg commented on April 4th 20 at 00:43
@keith_Stoltenberg, the Essence register_next_step_handle in creating multi-level bots, you send the keyboard in the same function that checks the contents of the messages, I was just in the start_message to send it and then transition to do - devante commented on April 4th 20 at 00:46
@devante, okay, I understand, but still, is there a possibility of moving to another function in other ways? - keith_Stoltenberg commented on April 4th 20 at 00:49
April 4th 20 at 00:42
@bot.message_handler(commands=['start'])
def start_message(message):
 bot.send_message(message.from_user.id, 'Bot successfully started')
 msg = bot.send_message(message.from_user.id, 'Menu features', reply_markup=keyboard['main'])
 bot.register_next_step_handler(msg, select_main)

def select_main(message):
 if message.text == 'Section 1':
 bot.send_message(message.chat.id f Open [{message.text}]')
 bot.register_next_step_handler(msg, select_content)

Find more questions by tags PythonTelegram