From f3605668242011c4005bd032ab859b2f3b8e222f Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Fri, 28 Mar 2025 21:22:07 -0400 Subject: [PATCH] refactor: minor changes --- commands/tools.py | 4 ++-- core.py | 7 ++++--- tasks.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/commands/tools.py b/commands/tools.py index 11aba19..28be021 100644 --- a/commands/tools.py +++ b/commands/tools.py @@ -14,13 +14,13 @@ async def lookup(message): tokens = commands.tokenize(message.content) parser = arguments.ArgumentParser( tokens[0], - "look up a user or application on discord by their ID", + "look up a discord user or application by ID", ) parser.add_argument( "-a", "--application", action="store_true", - help="search for applications instead of users", + help="look up applications instead of users", ) parser.add_argument( "id", diff --git a/core.py b/core.py index 3771584..1e7e0ee 100644 --- a/core.py +++ b/core.py @@ -166,6 +166,7 @@ async def on_voice_state_update(_, before, after): channel = before.channel elif is_empty(after.channel): channel = after.channel + if channel: await channel.guild.voice_client.disconnect() @@ -174,9 +175,9 @@ def rreload(reloaded_modules, module): reloaded_modules.add(module.__name__) for submodule in filter( - lambda v: inspect.ismodule(v) - and v.__name__ in RELOADABLE_MODULES - and v.__name__ not in reloaded_modules, + lambda sm: inspect.ismodule(sm) + and sm.__name__ in RELOADABLE_MODULES + and sm.__name__ not in reloaded_modules, vars(module).values(), ): rreload(reloaded_modules, submodule) diff --git a/tasks.py b/tasks.py index c0dbb57..a87b068 100644 --- a/tasks.py +++ b/tasks.py @@ -19,7 +19,7 @@ async def cleanup(): targets.append(guild_id) for target in targets: del players[target] - debug(f"cleanup removed {len(targets)} empty players") + debug(f"cleanup thread removed {len(targets)} empty players") if ( not idle_tracker["is_idle"]