aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar D0rs4n <[email protected]>2022-01-17 00:10:39 +0100
committerGravatar GitHub <[email protected]>2022-01-16 23:10:39 +0000
commitdc8c63fa92fbf8b74aafb17b5f58d67e079633b4 (patch)
tree5ebed4d0128b6e347d8b75a48134367a47c78668
parentMerge pull request #969 from onerandomusername/aoc-lb-message (diff)
Make error messages more consistent in the AoC daystar view (#973)
From now on, when the interacting user and the original author of the view is different, the bot will send an ephemeral message regarding the issue.
-rw-r--r--bot/exts/events/advent_of_code/views/dayandstarview.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/exts/events/advent_of_code/views/dayandstarview.py b/bot/exts/events/advent_of_code/views/dayandstarview.py
index a0bfa316..5529c12b 100644
--- a/bot/exts/events/advent_of_code/views/dayandstarview.py
+++ b/bot/exts/events/advent_of_code/views/dayandstarview.py
@@ -42,7 +42,13 @@ class AoCDropdownView(discord.ui.View):
async def interaction_check(self, interaction: discord.Interaction) -> bool:
"""Global check to ensure that the interacting user is the user who invoked the command originally."""
- return interaction.user == self.original_author
+ if interaction.user != self.original_author:
+ await interaction.response.send_message(
+ ":x: You can't interact with someone else's response. Please run the command yourself!",
+ ephemeral=True
+ )
+ return False
+ return True
@discord.ui.select(
placeholder="Day",