Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Simple Discord Bot
- By thepcgeek
- https://www.instructables.com/id/How-to-Make-a-Discord-Bot-Using-NodeJS/
- */
- const Discord = require("discord.js");
- const client = new Discord.Client();
- client.on("ready", ()=> {
- console.log("Superbot 3000 has initialized!");
- console.log("==User Information==");
- console.log(`Username: ${client.user.tag}`);
- });
- client.on("message", (message)=> {
- if(message.author.bot) return;
- var prefix = "sup";
- if(message.content.startsWith(prefix + " "))
- {
- //The command
- var commandSplit = message.content.split(" ");
- var command = commandSplit[1];
- //A simple switch
- switch(command)
- {
- case "hello":
- message.channel.send("Hello there!");
- break;
- }
- }
- });
- client.login("put your token here");
Advertisement
Add Comment
Please, Sign In to add comment