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

Betabot #81

Merged
merged 16 commits into from
Mar 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Morbo: Morbo can't understand his teleprompter because he forgot how …
…you say that letter that's shaped like a man wearing a hat.
  • Loading branch information
wootosmash committed Feb 29, 2020
commit ba323d8dd69a18f6b10472857dca0d9ca9c5785c
41 changes: 41 additions & 0 deletions src/commands/modules/adminrole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*jshint esversion: 9 */
const Command = require('@models/Command'),
config = require("@auth"),
util = require("util"),
Common = require('@helpers/common');

class AdminRole extends Command {

get group () { return 'control'; }
get hidden () { return true; }

execute ({input}) {
if (!input.args.length) return input.il8nResponse('adminrole.usage');
if (!input.ownerIsDev() && !input.ownerCanManageTheServer()) return input.il8nResponse('adminrole.notbotowner');

let roles = input.message.mentions.roles.concat(input.getNonSnowflakeRoles());
if ( roles.size == 0) {
input.il8nResponse('adminrole.none');
return;
}

input.server.adminrole = roles.first().id;

input.il8nResponse('adminrole.okay');
}
}

//registration
exports.register = (commands) => {
commands.addAll([
AdminRole.command
]);
};

exports.unRegister = (commands) => {
commands.removeAll([
AdminRole.command,
]);
};

exports.AdminRole = AdminRole;