Is it possible to change the callback?

@bot.callback_query_handler(lambda call: call.data == 'osh')
def callback_inline(call):

 if call.data == 'osh':
 bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text='Choose a region:',
reply_markup=markups.osh())
 if call.data == 'msk':
 bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text='Choose a region:',
reply_markup=markups.msk())

 if call.data == 'moblast':
 bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text='Select year:',
reply_markup=markups.moblast())
 if call.data == 'god1':
 bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text='Select phase:',
reply_markup=markups.god1())

 if call.data == 'nap1':
 bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text='Select object:',
 reply_markup=markups.nap1())


Decided to split my bot multiline into separate files, and faced with the problem of callback. I would like to understand whether it is possible in two files to enable the catcher calls @bot.callback_query_handler(func=lambda call: True) ? In practice we found that there is, but that is incorrect. The code consists of more than 1000 lines of similar inlines, which were previously combined in one catcher. Is it possible not to put instead if @bot.callback_query_handler(lambda call: call.data == 'osh') ?
April 7th 20 at 10:51
1 answer
April 7th 20 at 10:53
The problem is that all the "botopical" I do not regret learning the basics. All your openmalaysia if, for example, the dictionary and replaced with one line.

Find more questions by tags PythonBotsTelegram