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

Update ban / unban #238

Open
Hubyp opened this issue Sep 8, 2023 · 1 comment
Open

Update ban / unban #238

Hubyp opened this issue Sep 8, 2023 · 1 comment

Comments

@Hubyp
Copy link

Hubyp commented Sep 8, 2023

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);
    }
  }
};
@Hubyp
Copy link
Author

Hubyp commented Sep 8, 2023

if there is any problem, don't forget to contact me

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

No branches or pull requests

1 participant