Skip to content

Instantly share code, notes, and snippets.

@joshdrumz
Created November 19, 2022 20:47
Show Gist options
  • Save joshdrumz/aad97af259b0419f48339fa11f64fd3c to your computer and use it in GitHub Desktop.
Save joshdrumz/aad97af259b0419f48339fa11f64fd3c to your computer and use it in GitHub Desktop.
ABJ Detector Discord Bot
const { Client, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]
});
client.on(Events.MessageCreate, message => {
console.log('message detected');
if (message.author.bot || !message.guild) return;
// console.log(message);
const msgContent = message.content.toLowerCase();
const user = message.author;
const appleBottomJeans = 'apple bottom jeans'.toLowerCase();
const abj = 'abj'.toLowerCase();
if (msgContent.includes(appleBottomJeans) || msgContent.includes(abj)) {
message.channel.send(`Come on now, really? You should be ashamed of yourself. <@${user.id}>`);
message.delete();
}
});
client.login(token);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment