aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.idea/codeStyles/codeStyleConfig.xml5
-rw-r--r--.idea/discord.xml2
-rw-r--r--.idea/jsLibraryMappings.xml6
-rw-r--r--bot_discord.js58
-rw-r--r--commands/help.js2
-rw-r--r--commands/setup.js6
-rw-r--r--commands/slowdown.js37
-rw-r--r--quote.sqlitebin0 -> 16384 bytes
8 files changed, 99 insertions, 17 deletions
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+<component name="ProjectCodeStyleConfiguration">
+ <state>
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
+ </state>
+</component> \ No newline at end of file
diff --git a/.idea/discord.xml b/.idea/discord.xml
index 59b11d1..a04e4e5 100644
--- a/.idea/discord.xml
+++ b/.idea/discord.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
- <option name="show" value="true" />
+ <option name="show" value="PROJECT_FILES" />
</component>
<component name="ProjectNotificationSettings">
<option name="askShowProject" value="false" />
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
new file mode 100644
index 0000000..d23208f
--- /dev/null
+++ b/.idea/jsLibraryMappings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="JavaScriptLibraryMappings">
+ <includedPredefinedLibrary name="Node.js Core" />
+ </component>
+</project> \ No newline at end of file
diff --git a/bot_discord.js b/bot_discord.js
index e7f7714..6a51452 100644
--- a/bot_discord.js
+++ b/bot_discord.js
@@ -19,7 +19,7 @@
* *************************************/
const Discord = require('discord.js');
const moment = require('moment');
-const Sequelize = require('sequelize');
+//const Sequelize = require('sequelize');
const readline = require('readline');
const colors = require('colors');
const DBL = require('dblapi.js');
@@ -52,7 +52,7 @@ console.log('This program comes with ABSOLUTELY NO WARRANTY; for details type `s
console.log('This is free software, and you are welcome to redistribute it'.gray);
console.log('under certain conditions; type `show c\' for details.\n'.gray);
-if (process.argv.indexOf('--debug') == -1) {
+if (process.argv.indexOf('--debug') === -1) {
console.log('Running AleeBot without --debug command line flag. Debug output disabled.\n'.yellow);
} else {
console.log('[!] Entering debug mode...'.yellow);
@@ -64,7 +64,7 @@ if (process.argv.indexOf('--debug') == -1) {
});
}
-if (process.argv.indexOf('--beta') == -1) {
+if (process.argv.indexOf('--beta') === -1) {
client.login(api.abtoken).catch(function() {
console.log('[X] Login failed. The token that you put in is invalid, please put in a new one...'.red);
process.exit(0);
@@ -92,7 +92,7 @@ fs.readdir('./commands', (err, files) => {
log(`[!] Attempting to load "${alias}" as an alias for "${command.help.name}"`.cyan);
});
} catch (err) {
- log('[X] An error has occured trying to load a command. Here is the error.'.red);
+ log('[X] An error has occurred trying to load a command. Here is the error.'.red);
console.log(err.stack);
}
});
@@ -190,15 +190,49 @@ rl.on('line', function(cmd) {
}
rl.prompt();
});
+/*
+const sequelizeLogging = new Sequelize('database', 'user', 'password', {
+ host: 'localhost',
+ dialect: 'sqlite',
+ logging: false,
+ // SQLite only
+ storage: 'logging.sqlite',
+});
-const sequelize = new Sequelize('database', 'user', 'password', {
+const Logging = sequelizeLogging.define('logging', {
+ serverid: {
+ type: Sequelize.INTEGER,
+ unique: true,
+ },
+ channelid: Sequelize.INTEGER,
+ username: Sequelize.STRING,
+ usage_count: {
+ type: Sequelize.INTEGER,
+ defaultValue: 0,
+ allowNull: false,
+ },
+});
+
+const sequelizeQuote = new Sequelize('database', 'user', 'password', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
// SQLite only
- storage: 'database.sqlite',
+ storage: 'quote.sqlite',
});
+const Quote = sequelizeQuote.define('quote', {
+ quoteid: {
+ type: Sequelize.INTEGER,
+ unique: true,
+ },
+ author: Sequelize.STRING,
+ authorImage: Sequelize.STRING,
+ quote: Sequelize.STRING,
+ year: Sequelize.INTEGER
+});
+
+*/
client.on('ready', () => {
log('[>] AleeBot is now ready!'.green);
@@ -242,7 +276,7 @@ client.on('ready', () => {
client.on('guildMemberAdd', (member) => {
if (autoRole = true) {
- if (member.guild.id != '243022206437687296') return;
+ if (member.guild.id !== '243022206437687296') return;
const role = member.guild.roles.cache.get('657426918416580614');
member.roles.add(role);
log(`[i] ${member.user.username} joined Alee Productions.`.green);
@@ -258,7 +292,7 @@ client.on('guildMemberRemove', (member) =>{
*/
client.on('messageUpdate', async (oldMessage, newMessage) => {
- if (oldMessage.guild.id != '243022206437687296') return;
+ if (oldMessage.guild.id !== '243022206437687296') return;
if (oldMessage.content === newMessage.content) {
return;
}
@@ -278,7 +312,7 @@ client.on('messageUpdate', async (oldMessage, newMessage) => {
});
client.on('messageDelete', (message) => {
- if (message.guild.id != '243022206437687296') return;
+ if (message.guild.id !== '243022206437687296') return;
const logEmbed = new Discord.MessageEmbed()
.setAuthor('AleeBot Logging', client.user.avatarURL())
.setDescription(`A message from ${message.author.username} was deleted`)
@@ -294,7 +328,7 @@ client.on('messageDelete', (message) => {
});
client.on('guildBanAdd', (guild, user) => {
- if (guild.id != '243022206437687296') return;
+ if (guild.id !== '243022206437687296') return;
const logEmbed = new Discord.MessageEmbed()
.setAuthor('AleeBot Logging', client.user.avatarURL())
.setDescription(`This user got banned from ${guild.name}`)
@@ -310,7 +344,7 @@ client.on('guildBanAdd', (guild, user) => {
});
client.on('guildBanRemove', (guild, user) => {
- if (guild.id != '243022206437687296') return;
+ if (guild.id !== '243022206437687296') return;
const logEmbed = new Discord.MessageEmbed()
.setAuthor('AleeBot Logging', client.user.avatarURL())
.setDescription(`This user got unbanned from ${guild.name}`)
@@ -391,7 +425,7 @@ client.on('message', (msg) => {
}
if (cmd) {
- if (cmd.conf.guildOnly == true) {
+ if (cmd.conf.guildOnly === true) {
if (!msg.channel.guild) {
return msg.channel.createMessage('This command can only be ran in a guild.');
}
diff --git a/commands/help.js b/commands/help.js
index 36d4630..dce2974 100644
--- a/commands/help.js
+++ b/commands/help.js
@@ -19,7 +19,7 @@
* *************************************/
const Discord = require('discord.js');
const fs = require('fs');
-module.exports.run = async (client, message) => {
+module.exports.run = async (client, message) => {z
const categories = [];
const commands = Array.from(client.commands.keys());
const settings = require('../storage/settings.json');
diff --git a/commands/setup.js b/commands/setup.js
index c45fbae..bf6a14c 100644
--- a/commands/setup.js
+++ b/commands/setup.js
@@ -26,9 +26,9 @@ module.exports.run = async (client, message) => {
const setupEmbed = new Discord.MessageEmbed()
.setTitle('AleeBot Setup', client.user.avatarURL())
.setDescription('Select the options')
- .addField('Chat Logs', 'placeholder', true)
- .addField('Chat Logs', 'placeholder', true)
- .addField('Chat Logs', 'placeholder', true);
+ .addField('Logs', 'channelid', true)
+ // .addField('Chat Logs', 'placeholder', true)
+ // .addField('Chat Logs', 'placeholder', true);
message.author.send(setupEmbed);
};
diff --git a/commands/slowdown.js b/commands/slowdown.js
new file mode 100644
index 0000000..55e46e7
--- /dev/null
+++ b/commands/slowdown.js
@@ -0,0 +1,37 @@
+/** **************************************
+ *
+ * Slowdown: Command for AleeBot
+ * Copyright (C) 2017-2020 Alee Productions
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * *************************************/
+module.exports.run = async (client, message, args) => {
+ if (!message.member.permissions.has('MANAGE_CHANNELS')) return message.reply('It looks like that you don\'t have the permissions to slowdown messages.');
+ if (isNaN(args[0])) return message.reply('Please put the valid number of messages to purge.');
+ await message.channel.setRateLimitPerUser(args[0]);
+ message.channel.send(`This channel has been ratelimited for ${args[0]} second(s).`);
+
+};
+
+exports.conf = {
+ aliases: [],
+ guildOnly: false,
+};
+exports.help = {
+ name: 'slowdown',
+ description: 'Ratelimits channel.',
+ usage: 'slowdown [number]',
+ category: '- Moderation Commands',
+};
diff --git a/quote.sqlite b/quote.sqlite
new file mode 100644
index 0000000..c37a8a3
--- /dev/null
+++ b/quote.sqlite
Binary files differ