6
6
import discord
7
7
8
8
from discord .ext import commands
9
- from utils import BlacklistClearButton , BlacklistAddView , BlacklistRemoveView , ClearMessagesView , lift_ban , sanction
9
+ from utils import (
10
+ BlacklistClearButton ,
11
+ BlacklistAddView ,
12
+ BlacklistRemoveView ,
13
+ ClearMessagesView ,
14
+ lift_ban ,
15
+ sanction ,
16
+ )
10
17
11
18
FILEPATH = "files/blacklist.json"
12
19
@@ -106,7 +113,7 @@ async def unban(self, ctx: commands.Context, user: discord.User):
106
113
@commands .command (aliases = ["bladd" ])
107
114
@commands .has_permissions (manage_messages = True )
108
115
@commands .cooldown (1 , 2 , commands .BucketType .user )
109
- async def blacklist (self , ctx : commands .Context , * , words : str = None ):
116
+ async def blacklist (self , ctx : commands .Context , * , words : str = None ):
110
117
"""
111
118
⚙️ Bans words from being used.
112
119
@@ -200,7 +207,7 @@ async def showblacklist(self, ctx: commands.Context):
200
207
blacklist = self .client .cache .blacklist
201
208
server_id = str (ctx .guild .id )
202
209
203
- if server_id not in blacklist .keys ():
210
+ if server_id not in blacklist .keys () or not blacklist [ server_id ] :
204
211
return await ctx .send (
205
212
f"❌ { ctx .author .mention } : This server does not have any words blacklisted."
206
213
)
@@ -212,7 +219,7 @@ async def showblacklist(self, ctx: commands.Context):
212
219
213
220
@commands .command (aliases = ["blrem" ])
214
221
@commands .has_permissions (manage_messages = True )
215
- async def blacklistremove (self , ctx : commands .Context , * , words : str = None ):
222
+ async def blacklistremove (self , ctx : commands .Context , * , words : str = None ):
216
223
"""
217
224
⚙️ Removes a word from the list of banned words.
218
225
0 commit comments