@@ -49,6 +49,7 @@ async def sync(self, context: Context, scope: str) -> None:
4949 color = 0x9C84EF
5050 )
5151 await context .send (embed = embed )
52+ return
5253 elif scope == "guild" :
5354 context .bot .tree .copy_global_to (guild = context .guild )
5455 await context .bot .tree .sync (guild = context .guild )
@@ -58,13 +59,13 @@ async def sync(self, context: Context, scope: str) -> None:
5859 color = 0x9C84EF
5960 )
6061 await context .send (embed = embed )
61- else :
62- embed = discord .Embed (
63- title = "Invalid Scope" ,
64- description = "The scope must be `global` or `guild`." ,
65- color = 0xE02B2B
66- )
67- await context .send (embed = embed )
62+ return
63+ embed = discord .Embed (
64+ title = "Invalid Scope" ,
65+ description = "The scope must be `global` or `guild`." ,
66+ color = 0xE02B2B
67+ )
68+ await context .send (embed = embed )
6869
6970 @commands .command (
7071 name = "unsync" ,
@@ -89,6 +90,7 @@ async def unsync(self, context: Context, scope: str) -> None:
8990 color = 0x9C84EF
9091 )
9192 await context .send (embed = embed )
93+ return
9294 elif scope == "guild" :
9395 context .bot .tree .clear_commands (guild = context .guild )
9496 await context .bot .tree .sync (guild = context .guild )
@@ -98,13 +100,13 @@ async def unsync(self, context: Context, scope: str) -> None:
98100 color = 0x9C84EF
99101 )
100102 await context .send (embed = embed )
101- else :
102- embed = discord .Embed (
103- title = "Invalid Scope" ,
104- description = "The scope must be `global` or `guild`." ,
105- color = 0xE02B2B
106- )
107- await context .send (embed = embed )
103+ return
104+ embed = discord .Embed (
105+ title = "Invalid Scope" ,
106+ description = "The scope must be `global` or `guild`." ,
107+ color = 0xE02B2B
108+ )
109+ await context .send (embed = embed )
108110
109111 @commands .hybrid_command (
110112 name = "load" ,
@@ -121,16 +123,18 @@ async def load(self, context: Context, cog: str) -> None:
121123 """
122124 try :
123125 await self .bot .load_extension (f"cogs.{ cog } " )
124- except Exception as e :
126+ except Exception :
125127 embed = discord .Embed (
126128 title = "Error!" ,
127- description = f"Could not load the `{ cog } ` cog."
129+ description = f"Could not load the `{ cog } ` cog." ,
130+ color = 0xE02B2B
128131 )
129132 await context .send (embed = embed )
130133 return
131134 embed = discord .Embed (
132135 title = "Load" ,
133- description = f"Successfully loaded the `{ cog } ` cog."
136+ description = f"Successfully loaded the `{ cog } ` cog." ,
137+ color = 0x9C84EF
134138 )
135139 await context .send (embed = embed )
136140
@@ -149,16 +153,18 @@ async def unload(self, context: Context, cog: str) -> None:
149153 """
150154 try :
151155 await self .bot .unload_extension (f"cogs.{ cog } " )
152- except Exception as e :
156+ except Exception :
153157 embed = discord .Embed (
154158 title = "Error!" ,
155- description = f"Could not unload the `{ cog } ` cog."
159+ description = f"Could not unload the `{ cog } ` cog." ,
160+ color = 0xE02B2B
156161 )
157162 await context .send (embed = embed )
158163 return
159164 embed = discord .Embed (
160165 title = "Unload" ,
161- description = f"Successfully loaded the `{ cog } ` cog."
166+ description = f"Successfully unloaded the `{ cog } ` cog." ,
167+ color = 0x9C84EF
162168 )
163169 await context .send (embed = embed )
164170
@@ -177,16 +183,18 @@ async def reload(self, context: Context, cog: str) -> None:
177183 """
178184 try :
179185 await self .bot .reload_extension (f"cogs.{ cog } " )
180- except Exception as e :
186+ except Exception :
181187 embed = discord .Embed (
182188 title = "Error!" ,
183- description = f"Could not reload the `{ cog } ` cog."
189+ description = f"Could not reload the `{ cog } ` cog." ,
190+ color = 0xE02B2B
184191 )
185192 await context .send (embed = embed )
186193 return
187194 embed = discord .Embed (
188195 title = "Reload" ,
189- description = f"Successfully reloaded the `{ cog } ` cog."
196+ description = f"Successfully reloaded the `{ cog } ` cog." ,
197+ color = 0x9C84EF
190198 )
191199 await context .send (embed = embed )
192200
0 commit comments