-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace all relevant Interaction.send/followups with send_discord_message wrapper #59
Conversation
"Error in leaderboard creation.", | ||
ephemeral=True, | ||
) | ||
|
||
|
||
@discord.app_commands.describe(leaderboard_name="Name of the leaderboard") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexzhang13 I think we should just make it use our send_discord_message
in all cases, so would replace these interaction.response.send_message
with it as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh there's a weird case with embed=embed or whatever where it doesn't exactly work, but otherwise I can replace the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the issue with embed=embed
? Does one of the followup.send
or interaction.response.send_message
not support it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah they expect a message, but I can change this as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can work around this in a later PR though, for now I think we know what to expect for the embeds (it's always a followup) so we can keep it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd replace all occuranges of the discord default way with our wrapper, sadly I cannot mark those as Github doesn't allow comments on lines outside of PR, but in methods submit_modal
and get_leaderboard_submission
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also in here, would change the occurances, just so we're doing it all the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
To avoid issues where Discord complains about the correct usage of send / followup, we add a wrapper that checks which is valid, and uses the correct command. This feature is important for callbacks, where an existing response might exist, despite the GitHub slash command function assuming it does not.
Checklist
Before submitting this PR, ensure the following steps have been completed:
/verifyruns
on your own server./verifyruns
.runs may take a little longer. The Modal run is typically quick.)
For more information on running a cluster bot on your own server, see
README.md.