aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-08-02 19:33:30 -0400
committerAlee14 <Alee14498@gmail.com>2017-08-02 19:33:30 -0400
commit1a8e2cb7de3e65557d4115c0d162c788aff3d97e (patch)
treedf033843f2642185c86baed2f7c28c4db377db53
parent54ec23e6306d724f64dd2c7b1307e0b697366c69 (diff)
downloadAleeBot-1a8e2cb7de3e65557d4115c0d162c788aff3d97e.tar.gz
AleeBot-1a8e2cb7de3e65557d4115c0d162c788aff3d97e.tar.bz2
AleeBot-1a8e2cb7de3e65557d4115c0d162c788aff3d97e.zip
Adding a new command + file
-rw-r--r--aleebot.js18
-rw-r--r--consts.js10
2 files changed, 28 insertions, 0 deletions
diff --git a/aleebot.js b/aleebot.js
index 3cfcf07..0c253f6 100644
--- a/aleebot.js
+++ b/aleebot.js
@@ -11,6 +11,7 @@
const Discord = require('discord.js');
const client = new Discord.Client();
const config = require('./absettings.json');
+const consts = require('./consts.js');
const prefix = "ab:";
var abversion = "1.0.8";
@@ -157,9 +158,26 @@ client.on("message", function(message){
'ab:kick Kicks people\n' +
'ab:ban Bans People\n' +
"ab:rm Removes the message with a amount\n" +
+ "ab:leave Makes me leave the server\n" +
'Please note that we are still working on this feature!```');
}
+ if (command === "leave") {
+
+ if (message.author.id == consts.users.alee14 || message.author.id == message.guild.owner.user.id) {
+
+ message.reply("You want me to leave this server? Fine, i'm gone!").then(function() {
+
+ message.guild.leave();
+
+ } else {
+
+ message.reply("Hey! You don't have permission to kick me out of this server!");
+
+ }
+
+ return true;
+
});
process.on('unhandledRejection', function(err, p) {
diff --git a/consts.js b/consts.js
new file mode 100644
index 0000000..7a750ff
--- /dev/null
+++ b/consts.js
@@ -0,0 +1,10 @@
+
+module.exports = {
+
+ users: {
+
+ alee14: "242775871059001344"
+
+ }
+
+}