SHARE
TWEET

Bot Basics

a guest Oct 22nd, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Basics
  2. const { Client, RichEmbed } = require ("discord.js");
  3. const bot = new Client();
  4.  
  5. const token = ("");
  6.  
  7. const PREFIX = ("!");
  8.  
  9. bot.on('ready', () =>{
  10.     console.log("Bot is Ready!");
  11. });
  12.  
  13. // Commands
  14. bot.on('message', message =>{
  15.     let args = message.content.substring(PREFIX.lenght).split(" ");
  16.  
  17.     switch(args[0]){
  18.  
  19.         case "pool":
  20.             const Embed = new RichEmbed()
  21.             .setColor(0xFFC300)
  22.             .setTitle("Test")
  23.             .setDescription("This is a test!");
  24.  
  25.             if(!args[1]){
  26.                 message.channel.send(Embed);
  27.             break;
  28.             }
  29.  
  30.             let msgArgs = args.slice(1).join(" ");
  31.  
  32.             message.channel.send(msgArgs).then(messageReaction => {
  33.                 messageReaction.react("👍");
  34.                 messageReaction.react("👎");
  35.             })
  36.  
  37.         break;
  38.  
  39.     }
  40.  
  41. });
  42.  
  43. bot.login(token);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top