From fcc7bbd605a40e422ad080bbfcf5c9c4964571ad Mon Sep 17 00:00:00 2001 From: Luke R Date: Wed, 30 Apr 2025 14:28:10 -0700 Subject: [PATCH] Add error handlign to the /vc command --- app/cogs/server_utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/cogs/server_utils.py b/app/cogs/server_utils.py index 7c215f3f..e4fd424d 100755 --- a/app/cogs/server_utils.py +++ b/app/cogs/server_utils.py @@ -229,7 +229,10 @@ class ServerUtils(commands.Cog): # Check that the role/channel doesnt already exist # returns either a string or None, so we'll proceed on the None condition if discord.utils.find(lambda r: r.name == channel_role_name, ctx.guild.roles): - await ctx.send(f":x: A role named `{channel_role_name}` already exists :x:") + await ctx.respond( + f":x: A role named `{channel_role_name}` already exists :x:", + delete_after=3, + ) return # Create a role and assign it a random color @@ -258,11 +261,10 @@ class ServerUtils(commands.Cog): ) await ctx.respond( - ":white_check_mark: Created a role + voice channel for %s" - % role.mention + f":white_check_mark: Created a role + voice channel for {role.mention} :white_check_mark:" ) except Exception as e: - await ctx.respond(":x: Error: %s :x:" % e) + await ctx.respond(f":x: Error: {e} :x:") @commands.slash_command( guild_ids=None, name="topic", description="Change the channel's topic"