@@ -33,12 +33,8 @@ async def _handle_account_linked(self, body: WebhookBody, bot: Bot) -> dict:
3333 """
3434 Handles the account linked event.
3535 """
36- discord_id = self .validate_discord_id (
37- self .get_property_or_trait (body , "discord_id" )
38- )
39- account_id = self .validate_account_id (
40- self .get_property_or_trait (body , "account_id" )
41- )
36+ discord_id = self .validate_discord_id (self .get_property_or_trait (body , "discord_id" ))
37+ account_id = self .validate_account_id (self .get_property_or_trait (body , "account_id" ))
4238
4339 member = await self .get_guild_member (discord_id , bot )
4440 await process_account_identification (
@@ -55,9 +51,7 @@ async def _handle_account_linked(self, body: WebhookBody, bot: Bot) -> dict:
5551 f"Account linked: { account_id } -> ({ member .mention } ({ member .id } )" ,
5652 )
5753 else :
58- self .logger .warning (
59- f"Verify logs channel { settings .channels .VERIFY_LOGS } not found"
60- )
54+ self .logger .warning (f"Verify logs channel { settings .channels .VERIFY_LOGS } not found" )
6155 except Exception as e :
6256 self .logger .error (f"Failed to send verification log: { e } " )
6357 # Don't raise - this is not critical
@@ -73,17 +67,14 @@ async def _handle_account_unlinked(self, body: WebhookBody, bot: Bot) -> dict:
7367 """
7468 Handles the account unlinked event.
7569 """
76- discord_id = self .validate_discord_id (
77- self .get_property_or_trait (body , "discord_id" )
78- )
79- account_id = self .validate_account_id (
80- self .get_property_or_trait (body , "account_id" )
81- )
70+ discord_id = self .validate_discord_id (self .get_property_or_trait (body , "discord_id" ))
71+ account_id = self .validate_account_id (self .get_property_or_trait (body , "account_id" ))
8272
8373 member = await self .get_guild_member (discord_id , bot )
8474
8575 await member .remove_roles (
86- bot .guilds [0 ].get_role (settings .roles .VERIFIED ), atomic = True # type: ignore
76+ bot .guilds [0 ].get_role (settings .roles .VERIFIED ),
77+ atomic = True , # type: ignore
8778 ) # type: ignore
8879
8980 return self .success ()
@@ -104,15 +95,9 @@ async def _handle_account_banned(self, body: WebhookBody, bot: Bot) -> dict:
10495 """
10596 Handles the account banned event.
10697 """
107- discord_id = self .validate_discord_id (
108- self .get_property_or_trait (body , "discord_id" )
109- )
110- account_id = self .validate_account_id (
111- self .get_property_or_trait (body , "account_id" )
112- )
113- expires_at = self .validate_property (
114- self .get_property_or_trait (body , "expires_at" ), "expires_at"
115- )
98+ discord_id = self .validate_discord_id (self .get_property_or_trait (body , "discord_id" ))
99+ account_id = self .validate_account_id (self .get_property_or_trait (body , "account_id" ))
100+ expires_at = self .validate_property (self .get_property_or_trait (body , "expires_at" ), "expires_at" )
116101 reason = body .properties .get ("reason" )
117102 notes = body .properties .get ("notes" )
118103 created_by = body .properties .get ("created_by" )
@@ -122,9 +107,7 @@ async def _handle_account_banned(self, body: WebhookBody, bot: Bot) -> dict:
122107
123108 member = await self .get_guild_member (discord_id , bot )
124109 if not member :
125- self .logger .warning (
126- f"Cannot ban user { discord_id } - not found in guild" , extra = extra
127- )
110+ self .logger .warning (f"Cannot ban user { discord_id } - not found in guild" , extra = extra )
128111 return self .fail ()
129112
130113 # Use the generic ban helper to handle all the complex logic
@@ -142,9 +125,7 @@ async def _handle_account_banned(self, body: WebhookBody, bot: Bot) -> dict:
142125 extra_log_data = extra ,
143126 )
144127
145- self .logger .debug (
146- f"Platform ban handling result: { result ['action' ]} " , extra = extra
147- )
128+ self .logger .debug (f"Platform ban handling result: { result ['action' ]} " , extra = extra )
148129
149130 return self .success ()
150131
@@ -164,7 +145,8 @@ async def _handle_account_deleted(self, body: WebhookBody, bot: Bot) -> dict:
164145 return self .fail ()
165146
166147 await member .remove_roles (
167- bot .guilds [0 ].get_role (settings .roles .VERIFIED ), atomic = True # type: ignore
148+ bot .guilds [0 ].get_role (settings .roles .VERIFIED ),
149+ atomic = True , # type: ignore
168150 ) # type: ignore
169151
170152 return self .success ()
0 commit comments