summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-12-30 16:47:18 -0500
committerAlee14 <Alee14498@gmail.com>2017-12-30 16:47:18 -0500
commitb23c90a245b7f0440f03eeb23fb61ccbef9e3cc5 (patch)
tree6f158fe48fa3963692d5b7e6a8e79f50a4a6335a /src
parentcf0e69af80ab4677339eddc780c8637cc373e917 (diff)
downloadAleeBot-b23c90a245b7f0440f03eeb23fb61ccbef9e3cc5.tar.gz
AleeBot-b23c90a245b7f0440f03eeb23fb61ccbef9e3cc5.tar.bz2
AleeBot-b23c90a245b7f0440f03eeb23fb61ccbef9e3cc5.zip
Added blessed and fixes in help
Diffstat (limited to 'src')
-rw-r--r--src/bot_discord.js48
-rw-r--r--src/commands/help.js2
2 files changed, 5 insertions, 45 deletions
diff --git a/src/bot_discord.js b/src/bot_discord.js
index ac035d9..3e2f67c 100644
--- a/src/bot_discord.js
+++ b/src/bot_discord.js
@@ -10,6 +10,7 @@ const client = new Discord.Client();
const abVersion = "2.0.0 Beta";
const prefix = "abb:";
const fs = require("fs");
+const blessed = require('blessed');
const config = require('./absettings.json');
console.log(`Welcome to AleeBot NodeJS Terminal!`);
@@ -55,14 +56,6 @@ client.on("guildDelete", guild => {
console.log(`[i] I have been removed from: ${guild.name} (id: ${guild.id})`);
});
-/*
-client.on('guildMemberAdd', member => {
- member.guild.channels.find("name", "welcomes-and-byes").sendMessage(member.toString() + " has joined the server");
-});
-
-client.on('guildMemberRemove', member => {
- member.guild.channels.find("name", "welcomes-and-byes").sendMessage(`**${member.user.username}** has left the server`);
-}); */
client.on("message", function(message) {
@@ -76,42 +69,9 @@ client.on("message", function(message) {
if (!message.content.startsWith(prefix)) return;
- var cmd = bot.commands.get(cont[0])
- if (cmd) cmd.run(bot, message, args);
-
-/*
- if (command === 'help') {
- var embed = new Discord.RichEmbed()
- .setAuthor('AleeBot ' + abVersion + ` Help and on ${client.guilds.size} servers`, "https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048")
- .setDescription("Every command you input into AleeBot is `" + config.prefix + "`")
- .addField("- General Commands", "ping\nuptime\ngit", true)
- .setFooter("AleeCorp Copyright 2017")
- .setColor("#1fd619")
- message.channel.sendEmbed(embed);
- }
-
- if (command === 'ping') {
- message.reply("**PONG!** :ping_pong: " + Math.round(client.ping) + " ms");
- }
-
- if (command === 'uptime') {
- var uptime = parseInt(client.uptime);
- uptime = Math.floor(uptime / 1000);
- var uptimeMinutes = Math.floor(uptime / 60);
- var minutes = uptime % 60;
- var hours = 0;
- while (uptimeMinutes >= 60) {
- hours++;
- uptimeMinutes = uptimeMinutes - 60;
- }
- var uptimeSeconds = minutes % 60;
- message.channel.send(":clock3: AleeBot has been up for " + hours + " hours, " + uptimeMinutes + " minutes, and " + uptimeSeconds + " seconds.")
- }
-
- if (command === 'git') {
- message.author.send("I can see you want to contribute to this project.\nHere's the link: https://github.com/AleeCorp/AleeBot")
- }
- */
+ var cmd = client.commands.get(cont[0])
+ if (cmd) cmd.run(client, message, args);
+
});
client.login(config.abtoken).catch(function() {
console.log("[X] Login failed. Please contact Alee14#9928 or email him at alee14498@gmail.com.");
diff --git a/src/commands/help.js b/src/commands/help.js
index a57a7d5..e191bc1 100644
--- a/src/commands/help.js
+++ b/src/commands/help.js
@@ -1,4 +1,4 @@
-module.exports.run = async (bot, message, args) => {
+module.exports.run = async (client, message, args) => {
var embed = new Discord.RichEmbed()
.setAuthor('AleeBot ' + abVersion + ` Help and on ${client.guilds.size} servers`, "https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048")
.setDescription("Every command you input into AleeBot is `" + config.prefix + "`")