@@ -64,40 +64,28 @@ async def blacklist_info(self, inter, user: Member):
6464 if not await self .blacklist .blacklisted (user .id ):
6565 return await errorEmb (inter , f"{ user .mention } is not in the blacklist" )
6666 bl_user = await self .blacklist .get_user (user .id )
67- embed = Embed (
68- title = f"Blacklisted user: { user .name } " ,
69- color = disnake .Color .random (seed = user .name ),
70- )
67+ embed = Embed (title = f"Blacklisted user: { user .name } " , color = disnake .Color .random (seed = user .name ))
7168 embed .add_field (name = "Reason" , value = bl_user .reason , inline = False )
7269 embed .add_field (name = "Expires" , value = bl_user .get_expiry , inline = False )
7370 embed .add_field (name = "Bot" , value = bl_user .bot )
7471 embed .add_field (name = "Tickets" , value = bl_user .tickets )
7572 embed .add_field (name = "Tags" , value = bl_user .tags )
7673 await inter .send (embed = embed )
7774
78- @blacklist .sub_command_group (
79- name = "edit" , description = "Edit a user in the blacklist"
80- )
75+ @blacklist .sub_command_group (name = "edit" , description = "Edit a user in the blacklist" )
8176 async def edit (self , inter ):
8277 pass
8378
8479 @commands .has_permissions (manage_messages = True )
85- @edit .sub_command (
86- name = "flags" , description = "Edit the user's blacklist flags in the blacklist"
87- )
80+ @edit .sub_command (name = "flags" , description = "Edit the user's blacklist flags in the blacklist" )
8881 async def flags (self , inter , user : Member , bot : bool , tickets : bool , tags : bool ):
8982 if not await self .blacklist .blacklisted (user .id ):
9083 return await errorEmb (inter , f"{ user .mention } is not in the blacklist" )
9184 await self .blacklist .edit_flags (user .id , bot , tickets , tags )
92- await sucEmb (
93- inter ,
94- f"Edited { user .mention } 's blacklist flags to\n Bot: { bot } , Tickets: { tickets } , Tags: { tags } " ,
95- )
85+ await sucEmb (inter , f"Edited { user .mention } 's blacklist flags to\n Bot: { bot } , Tickets: { tickets } , Tags: { tags } " )
9686
9787 @commands .has_permissions (manage_messages = True )
98- @edit .sub_command (
99- name = "reason" , description = "Edit the user's blacklist reason in the blacklist"
100- )
88+ @edit .sub_command (name = "reason" , description = "Edit the user's blacklist reason in the blacklist" )
10189 async def reason (self , inter , user : Member , reason : str ):
10290 if not await self .blacklist .blacklisted (user .id ):
10391 return await errorEmb (inter , f"{ user .mention } is not in the blacklist" )
@@ -108,43 +96,29 @@ async def reason(self, inter, user: Member, reason: str):
10896 )
10997
11098 @commands .has_permissions (manage_messages = True )
111- @edit .sub_command (
112- name = "expiry" , description = "Edit the user's blacklist expiry in the blacklist"
113- )
99+ @edit .sub_command (name = "expiry" , description = "Edit the user's blacklist expiry in the blacklist" )
114100 async def expiry (self , inter , user : Member , expires : str ):
115101 if not await self .blacklist .blacklisted (user .id ):
116102 return await errorEmb (inter , f"{ user .mention } is not in the blacklist" )
117103 expiry = int ((await timeconversions .convert (expires )).dt .timestamp ())
118104 await self .blacklist .edit_expiry (user .id , expiry )
119- await sucEmb (
120- inter ,
121- f"Edited the expiry of { user .mention } 's blacklist to expire { get_expiry (expiry )} " ,
122- )
105+ await sucEmb (inter , f"Edited the expiry of { user .mention } 's blacklist to expire { get_expiry (expiry )} " )
123106 await self .check_user_removal (await self .blacklist .get_user (user .id ))
124107
125108 @commands .has_permissions (manage_messages = True )
126- @blacklist .sub_command (
127- name = "remove" , description = "Remove a user from the blacklist"
128- )
109+ @blacklist .sub_command (name = "remove" , description = "Remove a user from the blacklist" )
129110 async def remove (self , inter , user : Member ):
130111 if not await self .blacklist .blacklisted (user .id ):
131112 return await errorEmb (inter , f"{ user .mention } is not in the blacklist" )
132113 await self .blacklist .remove (user .id )
133- await sucEmb (
134- inter , f"{ user .mention } has been removed from blacklist" , ephemeral = False
135- )
114+ await sucEmb (inter , f"{ user .mention } has been removed from blacklist" , ephemeral = False )
136115
137116 @commands .has_permissions (manage_messages = True )
138117 @blacklist .sub_command (
139118 name = "add" ,
140119 description = "Add a user to the blacklist" ,
141120 options = [
142- Option (
143- "user" ,
144- description = "User to blacklist" ,
145- type = OptionType .user ,
146- required = True ,
147- ),
121+ Option ("user" , description = "User to blacklist" , type = OptionType .user , required = True ),
148122 Option (
149123 "bot" ,
150124 description = "Whether to blacklist the user from using the entire bot" ,
@@ -169,29 +143,12 @@ async def remove(self, inter, user: Member):
169143 type = OptionType .string ,
170144 required = False ,
171145 ),
172- Option (
173- "reason" ,
174- description = "Reason for blacklisting the user" ,
175- type = OptionType .string ,
176- required = False ,
177- ),
146+ Option ("reason" , description = "Reason for blacklisting the user" , type = OptionType .string , required = False ),
178147 ],
179148 )
180- async def blacklist_add (
181- self ,
182- inter ,
183- user ,
184- bot ,
185- tickets ,
186- tags ,
187- reason = "No Reason Specified" ,
188- expires = "never" ,
189- ):
149+ async def blacklist_add (self , inter , user , bot , tickets , tags , reason = "No Reason Specified" , expires = "never" ):
190150 if not any ((bot , tickets , tags )):
191- return await errorEmb (
192- inter ,
193- "You can't blacklist a user without specifying either bot, tickets and/or tags" ,
194- )
151+ return await errorEmb (inter , "You can't blacklist a user without specifying either bot, tickets and/or tags" )
195152 elif len (reason ) > 900 :
196153 return await errorEmb (inter , "Reason must be under 900 chars" )
197154 elif user .id == inter .author .id :
@@ -251,16 +208,11 @@ async def blacklist_list(self, inter):
251208 emb .description = f"Expires: { blacklist_list .get_expiry } \n Reason: { blacklist_list .reason } \n "
252209 blacklist_embs .append (emb )
253210
254- blacklist_embs .append (
255- Embed (color = self .bot .config .colors .invis , description = "The end ;D" )
256- )
211+ blacklist_embs .append (Embed (color = self .bot .config .colors .invis , description = "The end ;D" ))
257212 start_emb = Embed (title = "Blacklist" , color = self .bot .config .colors .invis )
258213 start_emb .description = f"There are currently { blacklist_count :,d} blacklisted user{ 's' if blacklist_count > 1 else '' } , use the arrows below to navigate through them"
259214 blacklist_embs .insert (0 , start_emb )
260- await inter .send (
261- embed = blacklist_embs [0 ],
262- view = CreatePaginator (blacklist_embs , inter .author .id ),
263- )
215+ await inter .send (embed = blacklist_embs [0 ], view = CreatePaginator (blacklist_embs , inter .author .id ))
264216
265217
266218def setup (bot ):
0 commit comments