Skip to content

Commit

Permalink
fix(Discord bot): Bot not deleting sticky messages
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmDevs authored Nov 13, 2023
1 parent 4d3fe12 commit 04fb6f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/bot-discord/src/events/messageCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {

const message = await channel.send({ embeds: [config.sticky.stickyMessage] });

if (msg.client.stickiedMessage && msg.client.stickiedMessage.deletable)
if (msg.client.stickiedMessage && channel.messages.cache.get(msg.client.stickiedMessage)?.deletable)
channel.messages.delete(msg.client.stickiedMessage).catch(() => {});

msg.client.stickiedMessage = message.id;
Expand Down

0 comments on commit 04fb6f1

Please sign in to comment.