Skip to content

Commit

Permalink
Improved search again button
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahesh0253 committed Apr 17, 2021
1 parent 0e617d1 commit 445ec0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def answer(bot, query):
file_type = None

offset = int(query.offset or 0)
reply_markup = get_reply_markup(bot.username)
reply_markup = get_reply_markup(bot.username, query=string)
files, next_offset = await get_search_results(string,
file_type=file_type,
max_results=MAX_RESULTS,
Expand Down Expand Up @@ -69,10 +69,10 @@ async def answer(bot, query):
switch_pm_parameter="okay")


def get_reply_markup(username):
def get_reply_markup(username, query):
url = 't.me/share/url?url=' + quote(SHARE_BUTTON_TEXT.format(username=username))
buttons = [[
InlineKeyboardButton('Search again', switch_inline_query_current_chat=''),
InlineKeyboardButton('Search again', switch_inline_query_current_chat=query),
InlineKeyboardButton('Share bot', url=url),
]]
return InlineKeyboardMarkup(buttons)
Expand Down

0 comments on commit 445ec0f

Please sign in to comment.