Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Urban Dictionary Command is broken #221

Open
Einarin opened this issue Jun 10, 2022 · 1 comment · May be fixed by #236
Open

The Urban Dictionary Command is broken #221

Einarin opened this issue Jun 10, 2022 · 1 comment · May be fixed by #236

Comments

@Einarin
Copy link
Collaborator

Einarin commented Jun 10, 2022

Haven't investigated in detail but the command appears completely broken, actually crashing the bot when used

@Shiva953 Shiva953 linked a pull request Apr 26, 2023 that will close this issue
@Hubyp
Copy link

Hubyp commented Sep 8, 2023

Here's a better version :

exports.ban = {
  usage: "<user> [days of messages to delete]",
  description: "bans the user, optionally deleting messages from them in the last x days",
  process: function(bot, msg, suffix) {
    var args = suffix.split(' ');
    var usertxt = args.shift();
    var days = args.shift();
    var user = resolveUser(msg, usertxt);
    if (user) {
      bot.banMember(user, msg.server, days, function() {
        msg.channel.send("banned user " + user + " id:" + user.id);
      });
    } else {
      msg.channel.send("couldn't uniquely resolve " + usertxt);
    }
  }
};

exports.unban = {
  usage: "<user>",
  description: "unbans the user.",
  process: function(bot, msg, suffix) {
    var args = suffix.split(' ');
    var usertxt = args.shift();
    var days = args.shift();
    var user = resolveUser(msg, usertxt);
    if (user) {
      bot.unbanMember(user, msg.server);
    } else {
      bot.send("couldn't uniquely resolve " + usertxt);
    }
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants