Skip to content

Commit

Permalink
disable preview
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed Feb 11, 2024
1 parent 2f562ed commit eb45e7e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions searchgram/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ def type_search_handler(client: "Client", message: "types.Message"):
refined_text = f"-t={chat_type} {user_filter} {keyword}"
client.send_chat_action(message.chat.id, enums.ChatAction.TYPING)
text, markup = parse_and_search(refined_text)
message.reply_text(text, quote=True, parse_mode=enums.ParseMode.MARKDOWN, reply_markup=markup)
message.reply_text(
text, quote=True, parse_mode=enums.ParseMode.MARKDOWN, reply_markup=markup, disable_web_page_preview=True
)


@app.on_message(filters.text & filters.incoming)
Expand All @@ -198,7 +200,9 @@ def search_handler(client: "Client", message: "types.Message"):
message.reply_document(file, quote=True, parse_mode=enums.ParseMode.MARKDOWN, reply_markup=markup)
file.close()
else:
message.reply_text(text, quote=True, parse_mode=enums.ParseMode.MARKDOWN, reply_markup=markup)
message.reply_text(
text, quote=True, parse_mode=enums.ParseMode.MARKDOWN, reply_markup=markup, disable_web_page_preview=True
)


@app.on_callback_query(filters.regex(r"n|p"))
Expand Down Expand Up @@ -231,7 +235,7 @@ def send_method_callback(client: "Client", callback_query: types.CallbackQuery):
refined_text = user_query
client.send_chat_action(message.chat.id, enums.ChatAction.TYPING)
new_text, new_markup = parse_and_search(refined_text, new_page)
message.edit_text(new_text, reply_markup=new_markup)
message.edit_text(new_text, reply_markup=new_markup, disable_web_page_preview=True)


if __name__ == "__main__":
Expand Down

0 comments on commit eb45e7e

Please sign in to comment.