Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Commit

Permalink
jfoajfoajf
Browse files Browse the repository at this point in the history
  • Loading branch information
zapteryx committed Aug 3, 2019
1 parent 714e5f2 commit 30189bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/management.js
Expand Up @@ -118,9 +118,10 @@ module.exports.actions = function (type, cmd, body, obj) {
else if (cmd == "kick") {
if (body == "") {obj.channel.createMessage("Please specify the user to kick.")}
else {
id = "";
if (obj.mentions.length >= 1 && text[0] == obj.mentions[0].mention) {id = obj.mentions[0].id}
else if (isNumeric(text[0])) {id = text[0]}
if (!id) {obj.channel.createMessage("Usernames are currently not supported. Please specify an ID or mention the user to kick.");}
if (id == "") {obj.channel.createMessage("Usernames are currently not supported. Please specify an ID or mention the user to kick.");}
else if (!obj.member.guild.members.get(bot.user.id).permission.has("kickMembers")) {obj.channel.createMessage("I'm lacking permissions to kick members.")}
else {
text = body.split(" ");
Expand All @@ -135,9 +136,10 @@ module.exports.actions = function (type, cmd, body, obj) {
else if (cmd == "ban") {
if (body == "") {obj.channel.createMessage("Please specify the user to ban.")}
else {
id = "";
if (obj.mentions.length >= 1 && text[0] == obj.mentions[0].mention) {id = obj.mentions[0].id}
else if (isNumeric(text[0])) {id = text[0]}
if (!id) {obj.channel.createMessage("Usernames are currently not supported. Please specify an ID or mention the user to ban.");}
if (id == "") {obj.channel.createMessage("Usernames are currently not supported. Please specify an ID or mention the user to ban.");}
else if (!obj.member.guild.members.get(bot.user.id).permission.has("banMembers")) {obj.channel.createMessage("I'm lacking permissions to ban members.")}
else {
text = body.split(" ");
Expand Down

0 comments on commit 30189bb

Please sign in to comment.