@@ -19,7 +19,7 @@ async def kick(self, context, member: discord.Member, *args):
19
19
embed = discord .Embed (
20
20
title = "Error!" ,
21
21
description = "User has Admin permissions." ,
22
- color = 0x00FF00
22
+ color = 0xFF0000
23
23
)
24
24
await context .send (embed = embed )
25
25
else :
@@ -52,7 +52,7 @@ async def kick(self, context, member: discord.Member, *args):
52
52
embed = discord .Embed (
53
53
title = "Error!" ,
54
54
description = "You don't have the permission to use this command." ,
55
- color = 0x00FF00
55
+ color = 0xFF0000
56
56
)
57
57
await context .send (embed = embed )
58
58
@@ -83,7 +83,7 @@ async def nick(self, context, member: discord.Member, *, name: str):
83
83
embed = discord .Embed (
84
84
title = "Error!" ,
85
85
description = "You don't have the permission to use this command." ,
86
- color = 0x00FF00
86
+ color = 0xFF0000
87
87
)
88
88
await context .send (embed = embed )
89
89
@@ -126,7 +126,7 @@ async def ban(self, context, member: discord.Member, *args):
126
126
embed = discord .Embed (
127
127
title = "Error!" ,
128
128
description = "You don't have the permission to use this command." ,
129
- color = 0x00FF00
129
+ color = 0xFF0000
130
130
)
131
131
await context .send (embed = embed )
132
132
@@ -155,7 +155,7 @@ async def warn(self, context, member: discord.Member, *args):
155
155
embed = discord .Embed (
156
156
title = "Error!" ,
157
157
description = "You don't have the permission to use this command." ,
158
- color = 0x00FF00
158
+ color = 0xFF0000
159
159
)
160
160
await context .send (embed = embed )
161
161
@@ -165,6 +165,24 @@ async def purge(self, context, number):
165
165
Delete a number of messages.
166
166
"""
167
167
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
168
186
purged_messages = await context .message .channel .purge (limit = number )
169
187
embed = discord .Embed (
170
188
title = "Chat Cleared!" ,
@@ -176,7 +194,7 @@ async def purge(self, context, number):
176
194
embed = discord .Embed (
177
195
title = "Error!" ,
178
196
description = "You don't have the permission to use this command." ,
179
- color = 0x00FF00
197
+ color = 0xFF0000
180
198
)
181
199
await context .send (embed = embed )
182
200
0 commit comments