Skip to content

Commit

Permalink
fix(nowplaying): hopefully fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvdkolk committed May 3, 2024
1 parent 6253232 commit ab0e362
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/commands/nowPlaying.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,12 @@ export default createCommand(NowPlayingCommand)
collector.on('end', async (buttonInteractions) => {
const userCache = cache.get(statsfmUser.id);
if (userCache) userCache.delete(currentlyPlaying.track.id);
const lastInteraction = buttonInteractions.last();
if (lastInteraction) {
const message = await lastInteraction.fetchReply();
const lastButtonInteraction = buttonInteractions.last();
if (lastButtonInteraction) {
await lastButtonInteraction.update({
components: [],
});
} else {
await message.edit({
components: [],
});
Expand Down

0 comments on commit ab0e362

Please sign in to comment.