Skip to content

Commit

Permalink
Workaround for possible Discord bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tiltowait committed May 18, 2024
1 parent 0ac441f commit c68794c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inconnu/vr/rolldisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def __init__(self, has_character, callback, timeout_handler, owner, buttons):

async def button_pressed(self, interaction):
"""Handle button presses."""
# I'm not sure why, but suddenly I'm getting IndexErrors when setting
# button states. No idea how this is possible, and it feels like a
# Discord bug. Nevertheless, here's a kludge to make the error go away
# for now.
if not self.children:
# No clue what to do, since it shouldn't even be possible to get
# here, so just shrug and disable everything.
await self.disable_items(interaction)

if self.owner != interaction.user:
await interaction.response.send_message(
"This button doesn't belong to you!", ephemeral=True
Expand Down

0 comments on commit c68794c

Please sign in to comment.