AleeBot/aleebot.js

210 lines
6.7 KiB
JavaScript
Raw Normal View History

2017-05-31 16:26:45 -04:00
/****************************************
2017-07-29 15:46:00 -04:00
*
* AleeBot for AleeArmy Community and other servers
* Copyright (C) 2017 AleeCorp
2017-05-31 16:26:45 -04:00
*
* This script is made by Alee14 and other people.
2017-07-27 16:15:27 -04:00
* Some stuff was made by Victor Tran (vicr123), swawesome95 (no longer a dev), Rain and AKidFromTheUK.
2017-07-27 21:29:16 -04:00
* Please say thanks to swawesome95 to laying the basics of this bot, and Rain for improving some of the code.
2017-07-29 15:46:00 -04:00
*
2017-05-31 16:26:45 -04:00
* *************************************/
2017-05-31 16:09:24 -04:00
const Discord = require('discord.js');
const client = new Discord.Client();
2017-07-29 17:57:02 -04:00
const config = require('./absettings.json');
2017-07-29 15:46:00 -04:00
const prefix = "ab:";
2017-07-29 20:58:35 -04:00
var ver = "1.0.7";
var logsChannel = "318874545593384970";
client.on('ready', () => {
console.log("[SUCCESS] AleeBot is now ready! Running version "+ ver +"!");
client.setInterval(setGame, 300000);
setGame();
});
//Only works for AleeAmry Community I need someone to work it for Public and it's disabled because it crashes AleeBot :(
/*client.on("guildMemberAdd", function(member) {
member.guild.channels.find("name", "welcomes-and-byes").sendMessage(member.toString() + " Welcome to the AleeArmy!");
});
client.on("guildMemberRemove", function(member) {
member.guild.channels.find("name", "welcomes-and-byes").sendMessage(member.toString() + " Nice knowing you bye...");
});*/
2017-07-29 15:46:00 -04:00
2017-05-31 16:09:24 -04:00
function setGame() {
var presence = {};
presence.game = {};
presence.status = "online";
presence.afk = false;
2017-07-29 15:46:00 -04:00
2017-05-31 16:09:24 -04:00
switch (Math.floor(Math.random() * 1000) % 27) {
case 0:
presence.game.name = "with ban buttons";
2017-07-27 21:29:16 -04:00
break;
2017-05-31 16:09:24 -04:00
case 1:
presence.game.name = "AleeOS or ShiftOS";
break;
case 2:
presence.game.name = "Annoy Alee";
break;
case 3:
presence.game.name = "with an internal bug";
break;
case 4:
presence.game.name = "in the forest";
break;
case 5:
presence.game.name = "bot games";
break;
case 6:
presence.game.name = "with binary code";
break;
case 7:
2017-05-31 19:50:39 -04:00
presence.game.name = "being very cool";
2017-05-31 16:09:24 -04:00
break;
case 8:
presence.game.name = "with supa weapon";
break;
case 9:
presence.game.name = "solving puzzles";
break;
case 10:
presence.game.name = "rewinding time";
break;
case 11:
presence.game.name = "checking archives";
break;
case 12:
presence.game.name = "being unbreakable";
break;
case 13:
presence.game.name = "sandwiches";
break;
case 14:
presence.game.name = "drawing pokemon";
break;
case 15:
presence.game.name = "obsessing";
break;
case 16:
presence.game.name = "the waiting game";
break;
case 17:
2017-06-11 22:59:43 -04:00
presence.game.name = "da VMware World!";
2017-05-31 16:09:24 -04:00
break;
case 18:
presence.game.name = "with hexagons";
break;
case 19:
presence.game.name = "with music";
break;
case 20:
presence.game.name = "being a ninja";
break;
case 21:
presence.game.name = "if money cant buy happiness then why is it so fabulous";
break;
case 22:
presence.game.name = "being awesome";
break;
case 23:
presence.game.name = "AleeCraft";
break;
case 24:
presence.game.name = "AleeChat";
break;
case 25:
2017-05-31 16:14:13 -04:00
presence.game.name = "For help ab:help";
2017-05-31 16:09:24 -04:00
break;
case 26:
presence.game.name = "trying to DJ";
break;
2017-05-31 16:09:24 -04:00
}
client.user.setPresence(presence);
}
/*
function wordFilter(content) {
var word = content.search(/\b(fuck|fag|faggot|fuck|fuk|fuc|fucc|ho|phuck|hentai|porn|slut|bitch|succ|fucking|shit|ass|asshole|mofo|motherfucker|fucker|damn|hell|dick|cock|sex|cunt|nigger|nigga)+\b/i);
2017-07-29 15:46:00 -04:00
if (word != -1) {
return true;
} else {
return false;
}
} */
2017-06-01 22:26:22 +00:00
client.on("message", function(message){
2017-07-29 16:31:10 -04:00
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
let command = message.content.split(" ")[0];
command = command.slice(prefix.length);
let args = message.content.split(" ").slice(1);
/* if (wordFilter(message.content))
{
message.delete();
client.channels.get('318874545593384970').sendMessage(":information_source: " + message.author.username + " just swore!");
console.log("[INFO] " + message.author.username + " just swore!");
switch (Math.floor(Math.random() * 1000) % 3) {
message.reply("You have been caught swearing.");
message.author.send("You have been caught swearing in AleeArmy Community.");
} */
2017-07-29 15:46:00 -04:00
2017-07-29 16:31:10 -04:00
if (command === 'help'){
2017-07-29 00:19:15 -04:00
var embed = new Discord.RichEmbed()
2017-07-29 15:46:00 -04:00
.addField('Commands for AleeBot!\n\n',
'**'+prefix+'profile** Shows your profile pic in a image.\n' +
'**'+prefix+'git** Shows the repo of AleeBot.\n' +
"**"+prefix+"ping** Type this command and you'll see ;).\n" +
'**'+prefix+'owner** Shows who made this bot.\n' +
'**'+prefix+'suggest** You suggest things (working progress).\n' +
'**'+prefix+'userinfo** Tells you your info about you.', true)
2017-07-29 20:56:44 -04:00
.setFooter("AleeBot Copyright 2017. The version that AleeBot's running is " + ver + "!")
2017-07-29 00:45:53 -04:00
.setColor(0x00FFFF)
2017-07-29 00:19:15 -04:00
message.channel.sendEmbed(embed);
2017-07-28 22:37:47 -04:00
}
2017-07-29 15:46:00 -04:00
2017-07-29 16:31:10 -04:00
if(command === 'profile'){
2017-06-01 22:26:22 +00:00
message.reply(message.author.avatarURL);
}
2017-07-29 16:31:10 -04:00
if(command === 'git'){
2017-07-27 15:52:31 -04:00
message.channel.send ('Here is the github repo: https://github.com/AleeCorp/AleeBot');
2017-06-01 22:26:22 +00:00
}
2017-07-29 16:31:10 -04:00
if(command === 'ping'){
2017-06-01 22:26:22 +00:00
message.reply('Pong! :ping_pong:');
}
2017-07-29 16:31:10 -04:00
if(command === 'owner'){
2017-07-29 21:28:14 -04:00
message.channel.send ('The person who made this bot is Alee14#9928!');
2017-06-01 22:26:22 +00:00
}
2017-07-29 16:31:10 -04:00
if(command === 'suggest'){
2017-06-06 20:18:46 +00:00
message.reply('Sorry this feature is still being worked on :(');
}
2017-07-29 15:46:00 -04:00
if(command === 'userinfo'){
var embed = new Discord.RichEmbed()
.setAuthor(message.author.username)
.setDescription("This is your user info!")
.setColor(0x00FFFF)
.addField("Username", `${message.author.username}#${message.author.discriminator}`)
.addField("Created At", message.author.createdAt)
message.channel.sendEmbed(embed);
}
if(command === 'serverinfo'){
var embed = new Discord.RichEmbed()
.addField("Coming soon!")
.setColor(0x00FFFF)
message.channel.sendEmbed(embed);
}
2017-06-06 20:18:46 +00:00
});
2017-06-01 22:26:22 +00:00
2017-07-29 15:46:00 -04:00
2017-06-01 19:59:50 +00:00
client.login (config.token).catch(function() {
2017-07-27 15:59:49 -04:00
console.log("[ERROR] Login failed. Please contact Alee14#9928 or email him at alee14498@gmail.com.");
2017-05-31 16:09:24 -04:00
});