Advertisement
ii_kinqm1ke

Swearing Filter

Jun 5th, 2020
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const commands = new discord.command.CommandGroup({
  2.   defaultPrefix: '!'
  3. });
  4.  
  5. let list: string[] = ['retard', 'fuck', 'ass', 'whore', 'bitch', 'dick'];
  6. //let cursetime: number = 0;
  7. const curses = new pylon.KVNamespace('Curses');
  8.  
  9. async function getCurse(userId: discord.Snowflake): Promise<number> {
  10.   const bal = await curses.get<number>(userId);
  11.   return bal || 0;
  12. }
  13.  
  14. //commands.raw('swearcount', (message) => message.reply(cursetime));
  15.  
  16. discord.on('MESSAGE_CREATE', async (message) => {
  17.   if (list.some((word) => message.content.toLowerCase().includes(word))) {
  18.     await message.reply('This is a christian server...');
  19.     console.log(Date.now);
  20.     await curses.put(message.author.id, 1);
  21.   }
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement