@@ -19,7 +19,7 @@ async def kick(self, context, member: discord.Member, *args):
1919 embed = discord .Embed (
2020 title = "Error!" ,
2121 description = "User has Admin permissions." ,
22- color = 0x00FF00
22+ color = 0xFF0000
2323 )
2424 await context .send (embed = embed )
2525 else :
@@ -52,7 +52,7 @@ async def kick(self, context, member: discord.Member, *args):
5252 embed = discord .Embed (
5353 title = "Error!" ,
5454 description = "You don't have the permission to use this command." ,
55- color = 0x00FF00
55+ color = 0xFF0000
5656 )
5757 await context .send (embed = embed )
5858
@@ -83,7 +83,7 @@ async def nick(self, context, member: discord.Member, *, name: str):
8383 embed = discord .Embed (
8484 title = "Error!" ,
8585 description = "You don't have the permission to use this command." ,
86- color = 0x00FF00
86+ color = 0xFF0000
8787 )
8888 await context .send (embed = embed )
8989
@@ -126,7 +126,7 @@ async def ban(self, context, member: discord.Member, *args):
126126 embed = discord .Embed (
127127 title = "Error!" ,
128128 description = "You don't have the permission to use this command." ,
129- color = 0x00FF00
129+ color = 0xFF0000
130130 )
131131 await context .send (embed = embed )
132132
@@ -155,7 +155,7 @@ async def warn(self, context, member: discord.Member, *args):
155155 embed = discord .Embed (
156156 title = "Error!" ,
157157 description = "You don't have the permission to use this command." ,
158- color = 0x00FF00
158+ color = 0xFF0000
159159 )
160160 await context .send (embed = embed )
161161
@@ -165,6 +165,24 @@ async def purge(self, context, number):
165165 Delete a number of messages.
166166 """
167167 if context .message .author .guild_permissions .administrator :
168+ try :
169+ number = int (number )
170+ except :
171+ embed = discord .Embed (
172+ title = "Error!" ,
173+ description = f"`{ number } ` is not a valid number." ,
174+ color = 0xFF0000
175+ )
176+ await context .send (embed = embed )
177+ return
178+ if number < 1 :
179+ embed = discord .Embed (
180+ title = "Error!" ,
181+ description = f"`{ number } ` is not a valid number." ,
182+ color = 0xFF0000
183+ )
184+ await context .send (embed = embed )
185+ return
168186 purged_messages = await context .message .channel .purge (limit = number )
169187 embed = discord .Embed (
170188 title = "Chat Cleared!" ,
@@ -176,7 +194,7 @@ async def purge(self, context, number):
176194 embed = discord .Embed (
177195 title = "Error!" ,
178196 description = "You don't have the permission to use this command." ,
179- color = 0x00FF00
197+ color = 0xFF0000
180198 )
181199 await context .send (embed = embed )
182200
0 commit comments