async def chatGPT(message: types.Message):
# Достаем chat_id из callback_data
chat_id = message.text.split()[-1]
await message.answer(chat_id, f"Chat ID: {chat_id}")
#регистрация
def register_handler_chatGPT(dp: Dispatcher):
dp.register_message_handler(chatGPT, commands=["chatGPT"])
if message.text == "Кнопка34":
import telebot
from telebot import types
import secondfile - (импорт файла#2)
"Токен"
@bot.message_handler(commands=['start'])
def hello(message):
(.............. и т.д.)
secondfile.setup(bot)
if __name__ == '__main__':
bot.polling(none_stop = True)
from telebot import types
def setup(bot):
@bot.message_handler(content_types=['text'])
def get_text_messages(message):
(....... и т.д.)
if __name__ == '__main__':
bot.polling(none_stop = True)