Skip to content

Commit

Permalink
fix: Prevent CannotSendMessages or CannotEmbedLinks on interaction (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
DenverCoder1 committed Oct 31, 2022
1 parent bb5b909 commit 7ba4d97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nextcord/ext/menus/menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,13 @@ def _verify_permissions(
permissions: Permissions,
):
is_thread = isinstance(channel, nextcord.Thread)
if is_thread and not permissions.send_messages_in_threads:
raise CannotSendMessages()
elif not is_thread and not permissions.send_messages:
if ctx is not None and (
(is_thread and not permissions.send_messages_in_threads)
or (not is_thread and not permissions.send_messages)
):
raise CannotSendMessages()

if self.check_embeds and not permissions.embed_links:
if ctx is not None and self.check_embeds and not permissions.embed_links:
raise CannotEmbedLinks()

self._can_remove_reactions = permissions.manage_messages
Expand Down

0 comments on commit 7ba4d97

Please sign in to comment.