summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-04-18 15:28:39 -0400
committerAlee <alee14498@gmail.com>2018-04-18 15:28:39 -0400
commit3b7935fdfe07b023823d89316874270082e2b56c (patch)
treeb54b27d5cb286da95bf777e3320574ae344c3058
parent6157fb64ec61dde05a1dc955037ef9d079bb41d9 (diff)
downloadAleeBot-3b7935fdfe07b023823d89316874270082e2b56c.tar.gz
AleeBot-3b7935fdfe07b023823d89316874270082e2b56c.tar.bz2
AleeBot-3b7935fdfe07b023823d89316874270082e2b56c.zip
New imrpove changes
-rw-r--r--.gitignore2
-rw-r--r--README.md2
-rw-r--r--absettings.json.example5
-rw-r--r--bot_discord.js14
-rw-r--r--commands/changelog.js4
-rw-r--r--commands/help.js4
-rw-r--r--test.js13
-rw-r--r--tokens.json.example3
8 files changed, 23 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore
index 7d59c6c..c91e03c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
node_modules/
-absettings\.json
+tokens\.json
ffmpeg.exe
diff --git a/README.md b/README.md
index c8ccd3d..4a6ea2a 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
# Tutorial for self hosting
-First get NodeJS then clone this repo then do `npm install` in the AleeBot folder after remove example in `absettings.json.example` then get your token from discord and finally run this in linux `./run_linux.sh` or for windows `run_win.bat`
+First get NodeJS then clone this repo then do `npm install` in the AleeBot folder after remove example in `tokens.json.example` then get your token from discord and finally run this in linux `./run_linux.sh` or for windows `run_win.bat`
# Contributors
Here's the list of people who helped me with AleeBot for discord servers
diff --git a/absettings.json.example b/absettings.json.example
deleted file mode 100644
index 09eb39c..0000000
--- a/absettings.json.example
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "abtoken": "token",
- "ownerID": "242775871059001344",
- "prefix": "ab:"
- }
diff --git a/bot_discord.js b/bot_discord.js
index 5b2054a..347d660 100644
--- a/bot_discord.js
+++ b/bot_discord.js
@@ -24,10 +24,9 @@ const DBL = require("dblapi.js");
const client = new Discord.Client({
disableEveryone: true
});
-const abVersion = '2.8.0';
-const prefix = 'ab:';
+const settings = require('./storage/settings.json')
const fs = require('fs');
-const config = require('./absettings.json');
+const config = require('./tokens.json');
const dbl = new DBL(config.dbltoken, client);
const log = message => {
@@ -82,13 +81,14 @@ fs.readdir('./commands', (err, files) => {
client.on('ready', () => {
log('[>] AleeBot is now ready!');
log(`[i] Logged in as ${client.user.tag}`);
+ log(`[i] Prefix: ${settings.prefix}`)
log(`[i] Bot ID: ${client.user.id}`);
log(`[i] Token: ${config.abtoken}`);
- log('[i] Running version ' + abVersion + ` and in ${client.guilds.size} guilds`);
+ log('[i] Running version ' + settings.abVersion + ` and in ${client.guilds.size} guilds`);
client.setInterval(function() {
const games = [
- 'AleeBot ' + abVersion + ' | ' + config.prefix + 'help',
+ 'AleeBot ' + settings.abVersion + ' | ' + config.prefix + 'help',
'Annoying Alee',
'Coding stuff',
'Drawing shapes',
@@ -126,8 +126,8 @@ client.on('guildDelete', guild => {
client.on('message', (msg) => {
if (msg.author.bot) return;
- if (!msg.content.startsWith(prefix)) return;
- const args = msg.content.slice(prefix.length).trim().split(/ +/g);
+ if (!msg.content.startsWith(settings.prefix)) return;
+ const args = msg.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift();
let cmd;
diff --git a/commands/changelog.js b/commands/changelog.js
index 10ea4ec..364c3fa 100644
--- a/commands/changelog.js
+++ b/commands/changelog.js
@@ -20,8 +20,8 @@
module.exports.run = async (client, message) => {
const Discord = require('discord.js');
const embed = new Discord.RichEmbed()
- .setAuthor('AleeBot ' + '2.8.0' + ' Changelog', 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048')
- .setDescription('What\'s new in AleeBot 2.7?')
+ .setAuthor('AleeBot ' + require('../storage/settings.json').abVersion + ' Changelog', 'https://cdn.discordapp.com/avatars/282547024547545109/6c147a444ae328c38145ef1f74169e38.png?size=2048')
+ .setDescription('What\'s new in AleeBot '+ require('../storage/settings.json').abVersion +'?')
.addField('[>] Suggest a feature for AleeBot!', 'You can now suggest a feature for AleeBot!')
.setColor('#1fd619');
message.channel.send({embed});
diff --git a/commands/help.js b/commands/help.js
index 5d13a2a..f6c380d 100644
--- a/commands/help.js
+++ b/commands/help.js
@@ -29,8 +29,8 @@ module.exports.run = async (client, message) => {
});
const embed = new Discord.RichEmbed()
- .setAuthor('AleeBot 2.8.0' + ` 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 `' + require('../absettings.json').prefix + '`')
+ .setAuthor('AleeBot ' + require('../storage/settings.json').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 `' + require('../storage/settings.json').prefix + '`')
.setColor('#1fd619')
.setFooter('AleeCorp Copyright 2018, Licensed with GPL-3.0');
diff --git a/test.js b/test.js
index da32b11..398bddf 100644
--- a/test.js
+++ b/test.js
@@ -20,11 +20,11 @@
const Discord = require('discord.js');
const economy = require('discord-eco');
const moment = require('moment');
+const DBL = require("dblapi.js");
const client = new Discord.Client({
disableEveryone: true
});
-const abVersion = '2.8.0';
-const prefix = 'ab:';
+const settings = require('./storage/settings.json')
const fs = require('fs');
const log = message => {
@@ -79,13 +79,14 @@ fs.readdir('./commands', (err, files) => {
client.on('ready', () => {
log('[>] AleeBot is now ready!');
log(`[i] Logged in as ${client.user.tag}`);
+ log(`[i] Prefix: ${settings.prefix}`)
log(`[i] Bot ID: ${client.user.id}`);
log(`[i] Token: ${config.abtoken}`);
- log('[i] Running version ' + abVersion + ` and in ${client.guilds.size} guilds`);
+ log('[i] Running version ' + settings.abVersion + ` and in ${client.guilds.size} guilds`);
client.setInterval(function() {
const games = [
- 'AleeBot ' + abVersion + ' | ' + config.prefix + 'help',
+ 'AleeBot ' + settings.abVersion + ' | ' + config.prefix + 'help',
'Annoying Alee',
'Coding stuff',
'Drawing shapes',
@@ -120,8 +121,8 @@ client.on('guildDelete', guild => {
client.on('message', (msg) => {
if (msg.author.bot) return;
- if (!msg.content.startsWith(prefix)) return;
- const args = msg.content.slice(prefix.length).trim().split(/ +/g);
+ if (!msg.content.startsWith(settings.prefix)) return;
+ const args = msg.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift();
let cmd;
diff --git a/tokens.json.example b/tokens.json.example
new file mode 100644
index 0000000..cdf8c27
--- /dev/null
+++ b/tokens.json.example
@@ -0,0 +1,3 @@
+{
+ "abtoken": "token"
+}