Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://discordapp.com/oauth2/authorize?client_id=458811785508552714&scope=bot&permissions=3533888
- const Discord = require("discord.js");
- const config = require("./config.json");
- const bot = new Discord.Client();
- bot.on("ready", function(){
- console.log("SlaveBot is ready for commands!");
- bot.user.setActivity('in the cotton field - !help');
- });
- bot.on("guildCreate", guild => {
- $channel = guild.channels.find(m => m.permissionsFor(guild.me).has('SEND_MESSAGES'));
- if($channel){
- message.channel.send('helllooooo');
- }
- console.log(`I've joined the guild ${guild.name} (${guild.id}), owned by ${guild.owner.user.username} (${guild.owner.user.id}).`);
- });
- bot.on("message", function(message){
- if(message.author.equals(bot.user)) return;
- if(!message.content.startsWith(PREFIX)) return;
- var args = message.content.substring(config.prefix.length).split(" ");
- switch(args[0].toLowerCase()){
- case "ping":
- message.channel.send("Pong!");
- break;
- default:
- message.channel.send(":x: Invalid command!");
- }
- });
- bot.login(config.token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement