Last active
June 30, 2021 21:56
-
-
Save logan-mcgee/0c0ca406c6ea7db649b2003a02126b23 to your computer and use it in GitHub Desktop.
an *actual* way to use discord.js to block stickers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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