1
from pyrogram import Client, filters
from pyrogram.types import CallbackQuery, InlineKeyboardButton, InlineKeyboardMarkup

app = Client(api_id=int(""), api_hash="", bot_token="")

app.on_message(filters.command("search")
def start(client, message):
  query = message.text.split(maxsplit=1)[-1]
  buttons = [[InlineKeyboardButton("test", "test")]]
  app.send_message(chat_id=message.chat.id, text="test", reply_markup=InlineKeyboardMarkup(buttons))

@app.on_callback_query()
def csearch(client, CallbackQuery):
  #some code

I wanted to use query from search function, in csearch function. I tried doing it with using global keyword but it doesn't work properly for multiple users. Is there any other way to do it?

Pookie
  • 11
  • 3

0 Answers0