eternnoir / pyTelegramBotAPI

Python Telegram bot api.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

switch_inline_query_current_chat doesn't work

GEEKGEEKOP opened this issue · comments

from telebot import types
import telebot

# Replace 'YOUR_BOT_TOKEN' with your bot's token
TOKEN = 'YOUR_BOT_TOKEN'

# Create a Telebot instance
bot = telebot.TeleBot(TOKEN)

# Define a handler for the /start command
@bot.message_handler(commands=['start'])
def handle_start(message):
    # Create an inline keyboard with a button for switch_inline_query_current_chat
    keyboard = types.InlineKeyboardMarkup()
    btn1 = types.InlineKeyboardButton("Send Inline Query", switch_inline_query_current_chat="hello")
    keyboard.add(btn1)

    # Send the keyboard with the button to the user
    bot.send_message(message.chat.id, "Please click the button:", reply_markup=keyboard)

# Start the bot
bot.polling()

it doesn't work for me?

fuck Certainly! It worked just now.