Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log("Code Starting...")
- const token = "botTokenHere";
- const prefix = "PrefixHere";
- console.log("Grabbing modules and bot...")
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- bot.once('ready', async => {
- bot.user.setActivity("on the server", {type: "PLAYING"});
- console.log("Ready Event initialised!");
- console.log("Starting bot...");
- });
- // bot.login(token).then(() => console.log("Bot started"));
- bot.on('message', async (message) => {
- if(message.author.bot || message.channel. type === "dm" || !message.content.startsWith(prefix)) return;
- const args = message.content.slice(prefix.length).trim().split(/ +/g);
- const command = args.shift().toLowerCase();
- if(command === "commandName"){
- // Command code here
- };
- });
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement