/[sudobot]/trunk/commands/modrole.js
ViewVC logotype

Contents of /trunk/commands/modrole.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (show annotations)
Mon Jul 29 17:28:13 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 935 byte(s)
Initial release v1.0.0
1 const MessageEmbed = require("../src/MessageEmbed");
2 const { escapeRegex } = require("../src/util");
3
4 module.exports = {
5 async handle(msg, cm) {
6 if (typeof cm.args[0] === 'undefined') {
7 await msg.reply({
8 embeds: [
9 new MessageEmbed()
10 .setColor('#f14a60')
11 .setDescription(`This command requires at least one argument.`)
12 ]
13 });
14
15 return;
16 }
17
18 let modrole = msg.mentions.roles?.first();
19
20 if (!modrole) {
21 modrole = cm.args[0].trim();
22 }
23 else {
24 modrole = modrole.id;
25 }
26
27 app.config.set("mod_role", modrole);
28
29 app.config.write();
30
31 await msg.reply({
32 embeds: [
33 new MessageEmbed()
34 .setDescription(`The moderator role has been updated.`)
35 ]
36 });
37 }
38 };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26