Skip to content
Snippets Groups Projects
Commit 082c4ace authored by Reviath's avatar Reviath
Browse files

Added multiplexer, update unban command.

parent 7bea4a93
No related branches found
No related tags found
No related merge requests found
const errors = require('../errors.json');
const multiplexer = require('../multiplexer/getuser');
exports.run = async (client, message, args) => {
if (!message.member.hasPermission('BAN_MEMBERS')) {
......@@ -8,18 +9,6 @@ exports.run = async (client, message, args) => {
return;
};
function GetUser(user) {
if (user.length == 18) {
return user;
} else if (user.length == 22) {
return user.slice(3, 21);
} else if (user.length == 21) {
return user.slice(3, 20);
} else {
return user;
};
};
const user = args[0]
if (!user) {
message.channel.send(errors.insufficient_args).catch(e => {
......@@ -40,7 +29,7 @@ exports.run = async (client, message, args) => {
});
return;
};
const ban = bans.find(b => b.user.id == GetUser(user));
const ban = bans.find(b => b.user.id == multiplexer.GetUser(user));
if (!ban) {
message.channel.send('Cannot find that user or that user is not banned.').catch(e => {
return;
......
module.exports = {
GetUser: (user) => {
if (user.length == 18) {
return user;
} else if (user.length == 22) {
return user.slice(3, 21);
} else if (user.length == 21) {
return user.slice(3, 20);
} else {
return user;
};
}
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment