Guest User

Bot

a guest
Dec 23rd, 2020
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Eris = require('eris');
  2.  
  3. const prefixes = ['>', '//', ','];
  4. const auth = require('./assets/auth.json');
  5.  
  6. const clientOptions = {
  7.     intents: [
  8.         "guilds",
  9.         "guildMessages"
  10.     ]
  11. };
  12.  
  13. const bot = new Eris.CommandClient(auth.token, clientOptions, {}, {
  14.     description: "A bot made to test various things",
  15.     owner: "Terrarian#9999",
  16.     prefix: `${prefixes}`
  17. });
  18.  
  19. require('../src/commands/loader');
  20.  
  21. bot.on("guildCreate", (guild) => { // When the client joins a new guild
  22.     console.log(`New guild: ${guild.name}`);
  23. });
  24.  
  25. bot.on("messageCreate", (msg) => { // When a message is created
  26.     console.log(`New message: ${msg.cleanContent}`);
  27.     if(msg.author.bot) return;
  28.     if(!prefixes.some(prefix => msg.content.startsWith(prefix))) return;
  29. });
  30.  
  31. bot.on("ready", () => { // When the bot is ready
  32.     console.log("Ready! Connected to Discord!");
  33. });
  34.  
  35. bot.connect();
Advertisement
Add Comment
Please, Sign In to add comment