Only the original player can interact
Taz03 opened this issue · 6 comments
Right now anyone can interact with a 2048 game, make it so that only the user who started the game can interact with it.
Implementation wise, pass the id of user who started the game to button and check weather it is still the same user interacting, otherwise just ignore the interaction or send a ephemeral message saying "You can't interact with this game" or similar.
Add user id here after command name
check user id this method after checking command name
getUser method available from SlashCommand package. https://ci.dv8tion.net/job/JDA/javadoc/net/dv8tion/jda/api/events/interaction/SlashCommandEvent.html
Suggestion: save Initial ID of user that creates game via slash command, then read ID of user initiating action and if they are not equal, ignore the action/ return a message.
@ooplesoft sure, assigned u. Yes thats the correct approach
@ooplesoft u will have to make a pr on this repo, which will then be reviewed and get merged