From c594fcdc7bbcdf978a5a7a38dd98d0e86607371c Mon Sep 17 00:00:00 2001 From: Adriene Hutchins Date: Wed, 19 Feb 2020 19:11:39 -0500 Subject: [PATCH] Added exit confirmation --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index cbaf48e..b5fb70b 100644 --- a/main.py +++ b/main.py @@ -71,6 +71,7 @@ async def search(ctx, *, query: str): @bot.command(aliases=['exit', 'reboot']) @commands.is_owner() async def restart(ctx): + await ctx.send(':zzz: **Restarting.**') exit() @bot.command() @@ -110,7 +111,6 @@ async def search_logic(query: str, type: str = None): with open('searxes.txt') as f: bot.instances = f.read().split('\n') instance = random.sample(bot.instances, k=1)[0] - bot.instances.remove(instance) print(f"Attempting to use {instance}") # Error Template @@ -143,6 +143,7 @@ async def search_logic(query: str, type: str = None): except (KeyError, IndexError) as e: # Reached if error with returned results print(f"{e} with instance {instance}, trying again.") + bot.instances.remove(instance) return await search_logic(query) # Recurse until good response # Send message