Skip to content

Commit

Permalink
Merge pull request #73 from tarolling/72-unknown-message-error
Browse files Browse the repository at this point in the history
Patch unknown message error
  • Loading branch information
tarolling authored Jul 17, 2024
2 parents de75922 + ce63152 commit 99e63e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion commands/rps/leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
.setName('lb')
.setDescription('View the global leaderboard.'),
async execute(interaction) {
interaction.deferReply()
await interaction.deferReply()
.catch(console.error);

const { client } = interaction;
Expand Down
8 changes: 5 additions & 3 deletions commands/rps/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module.exports = {
.setRequired(true)
),
async execute(interaction) {
await interaction.deferReply().catch(console.error);

const { user } = interaction;

const target = interaction.options.getUser('user');
Expand Down Expand Up @@ -52,7 +54,7 @@ module.exports = {
}).catch(console.error);
}

interaction.reply({ content: 'Challenge sent!', ephemeral: true }).catch(console.error);
interaction.reply({ content: 'Challenge sent! Waiting for response...', ephemeral: true }).catch(console.error);

const filter = i => i.user.id === target.id;

Expand All @@ -67,15 +69,15 @@ module.exports = {
playSeries('challenge', queue, interaction);
} else {
challengeMessage.edit({ content: 'Challenge declined.', embeds: [], components: [], ephemeral: true }).catch(console.error);
interaction.followUp({ content: 'Challenge declined.', ephemeral: true }).catch(console.error);
interaction.editReply({ content: 'Challenge declined.', ephemeral: true }).catch(console.error);
}
});

collector.on('end', async (collected, reason) => {
if (reason !== 'time') return;

challengeMessage.edit({ content: 'Challenge timed out.', embeds: [], components: [], ephemeral: true }).catch(console.error);
interaction.followUp({ content: 'Challenge timed out.', ephemeral: true }).catch(console.error);
interaction.editReply({ content: 'Challenge timed out.', ephemeral: true }).catch(console.error);
});
}
};

0 comments on commit 99e63e3

Please sign in to comment.