@@ -143,7 +143,7 @@ async def send_error(self, ctx: AnyContext, content: str | None = None, **kwargs
143143 )
144144 if isinstance (ctx , commands .Context ):
145145 components .insert_item (0 , DeleteButton (ctx .author , initial_message = ctx .message ))
146- app_permissions = ctx .channel . permissions_for ( ctx . me ) # pyright: ignore[reportArgumentType]
146+ app_permissions = ctx .app_permissions
147147 if app_permissions .manage_messages :
148148 send_error = functools .partial (
149149 ctx .reply ,
@@ -223,13 +223,9 @@ async def handle_bot_missing_perms(
223223 ) -> None :
224224 """Handles bot missing permissing by dming the user if they have a permission which may be able to fix this."""
225225 embed = self .error_embed ("Permissions Failure" , str (error ))
226- if isinstance (ctx , commands .Context ):
227- app_permissions = ctx .channel .permissions_for (ctx .me ) # pyright: ignore[reportArgumentType]
228- else :
229- app_permissions = ctx .app_permissions
230- if app_permissions >= disnake .Permissions (send_messages = True , embed_links = True ):
226+ if ctx .app_permissions >= disnake .Permissions (send_messages = True , embed_links = True ):
231227 await self .send_error (ctx , embeds = [embed ])
232- elif app_permissions >= disnake .Permissions (send_messages = True ):
228+ elif ctx . app_permissions >= disnake .Permissions (send_messages = True ):
233229 # make a message as similar to the embed, using as few permissions as possible
234230 # this is the only place we send a standard message instead of an embed
235231 # so no helper methods are necessary
0 commit comments