fix messagge telegram_bot option 0 (Streamingcommunity)

This commit is contained in:
GiuDev 2025-05-13 10:35:57 +02:00
parent abf8e37e0f
commit e36ab9d0e5

View File

@ -96,7 +96,21 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
return
if string_to_search is None:
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
if site_constant.TELEGRAM_BOT:
bot = get_bot_instance()
string_to_search = bot.ask(
"key_search",
f"Enter the search term\nor type 'back' to return to the menu: ",
None
)
if string_to_search == 'back':
# Restart the script
subprocess.Popen([sys.executable] + sys.argv)
sys.exit()
else:
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
# Search on database
len_database = title_search(string_to_search)