Code To Recieve & Reply Message From Users
Code To Recieve & Reply Message From Users
bot = telebot.TeleBot(TOKEN1)
admin_chat_id = ADMIN
#------------------------------
def main_menu_keyboard():
keyboard.add(telebot.types.KeyboardButton("Send Message"))
return keyboard
@bot.message_handler(commands=['start'])
def start(message):
def send_message(message):
bot.register_next_step_handler(message, forward_message_to_admin)
# Handler to forward the message to the admin
def forward_message_to_admin(message):
inline_button = telebot.types.InlineKeyboardMarkup()
inline_button.add(telebot.types.InlineKeyboardButton("Reply", callback_data=f"reply:
{message.from_user.id}"))
def reply_to_user(call):
user_id = call.data.split(':')[1]
# Start polling
bot.polling()