Skip to content

Instantly share code, notes, and snippets.

@logan-mcgee
Last active June 30, 2021 21:56
Show Gist options
  • Save logan-mcgee/0c0ca406c6ea7db649b2003a02126b23 to your computer and use it in GitHub Desktop.
Save logan-mcgee/0c0ca406c6ea7db649b2003a02126b23 to your computer and use it in GitHub Desktop.
an *actual* way to use discord.js to block stickers
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('raw', (packet) => {
if (packet.t === 'MESSAGE_CREATE') {
const msg = packet.d;
if (msg?.stickers) {
client.channels.cache.get(msg.channel_id).messages.fetch(msg.id).then(message => message.delete().catch(console.log)).catch(console.log);
}
}
});
client.login('TOKEN');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment