@@ -185,12 +185,12 @@ async def grant_xp(self, message):
185185
186186 async def handle_message (self , message : Message ):
187187 if any (
188- [
189- message .guild is None ,
190- message .author .bot ,
191- message .type not in [MessageType .default , MessageType .reply , MessageType .thread_starter_message ],
192- message .content .__len__ () < 5 ,
193- ]
188+ [
189+ message .guild is None ,
190+ message .author .bot ,
191+ message .type not in [MessageType .default , MessageType .reply , MessageType .thread_starter_message ],
192+ message .content .__len__ () < 5 ,
193+ ]
194194 ):
195195 return
196196 if not random .randint (1 , 3 ) == 1 :
@@ -420,12 +420,14 @@ async def leaderboard(self, inter: ApplicationCommandInteraction):
420420 for i , record in enumerate (records ):
421421 user = await self .bot .fetch_user (record .user_id )
422422 if record .user_id == inter .author .id :
423- embed .add_field (name = f"{ i + 1 } . { user } ~ You " ,
424- value = f"Level: { record .lvl } \n Total XP: { record .total_exp :,} " , inline = False )
423+ embed .add_field (
424+ name = f"{ i + 1 } . { user } ~ You " , value = f"Level: { record .lvl } \n Total XP: { record .total_exp :,} " , inline = False
425+ )
425426 set_user = True
426427 else :
427- embed .add_field (name = f"{ i + 1 } . { user } " , value = f"Level: { record .lvl } \n Total XP: { record .total_exp :,} " ,
428- inline = False )
428+ embed .add_field (
429+ name = f"{ i + 1 } . { user } " , value = f"Level: { record .lvl } \n Total XP: { record .total_exp :,} " , inline = False
430+ )
429431 if not set_user :
430432 rank = await self .controller .get_rank (inter .guild .id , cmd_user )
431433 embed .add_field (
@@ -443,10 +445,10 @@ async def leaderboard(self, inter: ApplicationCommandInteraction):
443445 @commands .guild_only ()
444446 @commands .has_any_role ("Staff" , "staff" )
445447 async def set_lvl (
446- self ,
447- inter : ApplicationCommandInteraction ,
448- user : Member ,
449- level : int = Param (description = "The level to set the user to" , le = 100 , ge = 0 ),
448+ self ,
449+ inter : ApplicationCommandInteraction ,
450+ user : Member ,
451+ level : int = Param (description = "The level to set the user to" , le = 100 , ge = 0 ),
450452 ):
451453 """
452454 Set a user's level
@@ -471,17 +473,16 @@ async def role_reward(self, inter: ApplicationCommandInteraction):
471473 @role_reward .sub_command ()
472474 @commands .has_permissions (manage_roles = True )
473475 async def add (
474- self ,
475- inter : ApplicationCommandInteraction ,
476- role : Role = Param (name = "role" , description = "what role to give" ),
477- level_needed : int = Param (name = "level_needed" , description = "The level needed to get the role" ),
476+ self ,
477+ inter : ApplicationCommandInteraction ,
478+ role : Role = Param (name = "role" , description = "what role to give" ),
479+ level_needed : int = Param (name = "level_needed" , description = "The level needed to get the role" ),
478480 ):
479481 """adds a role to the reward list"""
480482 if int (level_needed ) not in self .levels :
481483 return await errorEmb (inter , text = f"Level must be within 1-{ MAX_LEVEL } found" )
482484
483- if await self .bot .db .execute ("SELECT 1 FROM role_rewards WHERE guild_id = ? AND role_id = ?" ,
484- (inter .guild .id , role .id )):
485+ if await self .bot .db .execute ("SELECT 1 FROM role_rewards WHERE guild_id = ? AND role_id = ?" , (inter .guild .id , role .id )):
485486 sql = "INSERT OR IGNORE INTO role_rewards (guild_id, role_id, required_lvl) VALUES (?, ?, ?)"
486487 await self .bot .db .execute (sql , (inter .guild .id , role .id , level_needed ))
487488 await self .bot .db .commit ()
@@ -491,13 +492,12 @@ async def add(
491492 @role_reward .sub_command ()
492493 @commands .has_permissions (manage_roles = True )
493494 async def remove (
494- self ,
495- inter : ApplicationCommandInteraction ,
496- role : Role = Param (name = "role" , description = "what role to remove" ),
495+ self ,
496+ inter : ApplicationCommandInteraction ,
497+ role : Role = Param (name = "role" , description = "what role to remove" ),
497498 ):
498499 """remove a role reward"""
499- if await self .bot .db .execute ("SELECT 1 FROM role_rewards WHERE guild_id = ? AND role_id = ?" ,
500- (inter .guild .id , role .id )):
500+ if await self .bot .db .execute ("SELECT 1 FROM role_rewards WHERE guild_id = ? AND role_id = ?" , (inter .guild .id , role .id )):
501501 sql = "DELETE FROM role_rewards WHERE guild_id = ? AND role_id = ?"
502502 await self .bot .db .execute (sql , (inter .guild .id , role .id ))
503503 await self .bot .db .commit ()
@@ -517,11 +517,9 @@ async def list(self, inter: ApplicationCommandInteraction):
517517 for record in records :
518518 record = RoleReward (* record )
519519 embed .add_field (
520- name = f"Level { record .required_lvl } " , value = f"{ inter .guild .get_role (record .role_id ).mention } " ,
521- inline = False
520+ name = f"Level { record .required_lvl } " , value = f"{ inter .guild .get_role (record .role_id ).mention } " , inline = False
522521 )
523- await inter .send (embed = embed ,
524- allowed_mentions = disnake .AllowedMentions (everyone = False , roles = False , users = False ))
522+ await inter .send (embed = embed , allowed_mentions = disnake .AllowedMentions (everyone = False , roles = False , users = False ))
525523
526524
527525def setup (bot : OGIROID ):
0 commit comments