//initialize alpha-bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
//shows bot status in the console
bot.on("ready", function (evt) {
logger.info("Connected");
logger.info("Logged in as: ");
logger.info(bot.username + " - (" + bot.id + ")");
});
bot.on("message", function (user, userID, channelID, message, evt, Member, client, VoiceChannels) {
//bots presence:
bot.setPresence({
game:{
name: "Serving the Pack"
}
});
//Bot needs to know when to execute a command
//listens to messages starting with
if (message.substring(0, 1) == "") {
var args = message.substring(1).split(" ");
var cmd = args[0];
args = args.splice(1);
switch(cmd) {
// *ping
case "ping":
bot.sendMessage({
to: channelID,
message: "Pong"
});
//join voice
case "join":
bot.joinVoiceChannel(channelID, function(error, events){});
break;
//case commands here
}
}
});
This is my current code, but the join command won't work
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is my current code, but the join command won't work
Thanks in advance