PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 1 | import { LoadingEmbed } from "../../utils/defaults.js"; |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 2 | import Discord, { CommandInteraction, GuildMember, Message, ActionRowBuilder, ButtonBuilder, ButtonStyle, APIMessageComponentEmoji, StringSelectMenuBuilder, MessageComponentInteraction, StringSelectMenuInteraction, StringSelectMenuOptionBuilder } from "discord.js"; |
| 3 | import type { SlashCommandSubcommandBuilder } from "discord.js"; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 4 | import EmojiEmbed from "../../utils/generateEmojiEmbed.js"; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 5 | import getEmojiByName from "../../utils/getEmojiByName.js"; |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 6 | import addPlural from "../../utils/plurals.js"; |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 7 | import client from "../../utils/client.js"; |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 8 | import { createVerticalTrack } from "../../utils/createPageIndicator.js"; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 9 | |
| 10 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 11 | builder |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 12 | .setName("track") |
| 13 | .setDescription("Moves a user along a role track") |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 14 | .addUserOption((option) => option.setName("user").setDescription("The user to manage").setRequired(true)); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 15 | |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 16 | const callback = async (interaction: CommandInteraction): Promise<unknown> => { |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 17 | const { renderUser, renderRole} = client.logger; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 18 | const member = interaction.options.getMember("user") as GuildMember; |
| 19 | const guild = interaction.guild; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 20 | if (!guild) return; |
| 21 | const config = await client.database.guilds.read(guild.id); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 22 | await interaction.reply({ embeds: LoadingEmbed, ephemeral: true }); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 23 | let track = 0; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 24 | let generated; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 25 | const roles = await guild.roles.fetch(); |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 26 | const memberRoles = member.roles; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 27 | let managed: boolean; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 28 | let timedOut = false; |
| 29 | while (!timedOut) { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 30 | const data = config.tracks[track]!; |
PineaFan | 638eb13 | 2023-01-19 10:41:22 +0000 | [diff] [blame] | 31 | if (data.manageableBy.length) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 32 | managed = data.manageableBy.some((element: string) => { |
| 33 | return memberRoles.cache.has(element); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 34 | }); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 35 | else managed = false; |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 36 | const dropdown = new Discord.StringSelectMenuBuilder() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 37 | .addOptions( |
| 38 | config.tracks.map((option, index) => { |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 39 | const hasRoleInTrack: boolean = option.track.some((element: string) => { |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 40 | return memberRoles.cache.has(element); |
| 41 | }); |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 42 | return new StringSelectMenuOptionBuilder({ |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 43 | default: index === track, |
| 44 | label: option.name, |
| 45 | value: index.toString(), |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 46 | description: option.track.length === 0 ? "No" : addPlural(option.track.length, "role"), |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 47 | emoji: client.emojis.resolve( |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 48 | getEmojiByName("TRACKS.SINGLE." + (hasRoleInTrack ? "ACTIVE" : "INACTIVE"), "id") |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 49 | ) as APIMessageComponentEmoji |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 50 | }); |
| 51 | }) |
| 52 | ) |
| 53 | .setCustomId("select") |
| 54 | .setMaxValues(1); |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 55 | const allowed: boolean[] = []; |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 56 | generated = "**Track:** " + data.name + "\n" + "**Member:** " + renderUser(member.user) + "\n"; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 57 | generated += |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 58 | (data.nullable ? "Members do not need a role in this track" : "A role in this track is required") + "\n"; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 59 | generated += |
| 60 | (data.retainPrevious |
| 61 | ? "When promoted, the user keeps previous roles" |
| 62 | : "Members will lose their current role when promoted") + "\n"; |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 63 | for (const role of data.track) { |
| 64 | const disabled: boolean = |
| 65 | roles.get(role)!.position >= (interaction.member as GuildMember).roles.highest.position && !managed; |
| 66 | allowed.push(!disabled) |
| 67 | } |
| 68 | generated += "\n" + createVerticalTrack( |
| 69 | data.track.map((role) => renderRole(roles.get(role)!)), |
| 70 | data.track.map((role) => memberRoles.cache.has(role)), |
| 71 | allowed.map((allow) => !allow) |
| 72 | ); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 73 | const selected = []; |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 74 | for (const position of data.track) { |
| 75 | if (memberRoles.cache.has(position)) selected.push(position); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 76 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 77 | const conflict = data.retainPrevious ? false : selected.length > 1; |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 78 | let conflictDropdown: StringSelectMenuBuilder[] = []; |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 79 | const conflictDropdownOptions: StringSelectMenuOptionBuilder[] = []; |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 80 | let currentRoleIndex: number = -1; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 81 | if (conflict) { |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 82 | generated += `\n\n${getEmojiByName(`PUNISH.WARN.${managed ? "YELLOW" : "RED"}`)} This user has ${ |
| 83 | selected.length |
| 84 | } roles from this track. `; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 85 | conflictDropdown = []; |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 86 | if (roles.get(selected[0]!)!.position < memberRoles.highest.position || managed) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 87 | generated += |
| 88 | "In order to promote or demote this user, you must select which role the member should keep."; |
| 89 | selected.forEach((role) => { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 90 | conflictDropdownOptions.push( |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 91 | new StringSelectMenuOptionBuilder() |
| 92 | .setLabel(roles.get(role)!.name) |
| 93 | .setValue(roles.get(role)!.id) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 94 | ); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 95 | }); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 96 | conflictDropdown = [ |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 97 | new Discord.StringSelectMenuBuilder() |
| 98 | .addOptions(conflictDropdownOptions) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 99 | .setCustomId("conflict") |
| 100 | .setMaxValues(1) |
| 101 | .setPlaceholder("Select a role to keep") |
| 102 | ]; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 103 | } else { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 104 | generated += |
| 105 | "You don't have permission to manage one or more of the users roles, and therefore can't select one to keep."; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 106 | } |
| 107 | } else { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 108 | currentRoleIndex = selected.length === 0 ? -1 : data.track.indexOf(selected[0]!.toString()); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 109 | } |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 110 | const m = (await interaction.editReply({ |
| 111 | embeds: [ |
| 112 | new EmojiEmbed() |
| 113 | .setEmoji("TRACKS.ICON") |
| 114 | .setTitle("Tracks") |
| 115 | .setDescription(`${generated}`) |
| 116 | .setStatus("Success") |
| 117 | ], |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 118 | components: [new ActionRowBuilder<StringSelectMenuBuilder | ButtonBuilder>().addComponents(dropdown)] |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 119 | .concat( |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 120 | conflict && conflictDropdown.length ? [new ActionRowBuilder<StringSelectMenuBuilder>().addComponents(conflictDropdown)] : [] |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 121 | ) |
| 122 | .concat([ |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 123 | new ActionRowBuilder<ButtonBuilder>().addComponents([ |
TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 124 | new ButtonBuilder() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 125 | .setEmoji(getEmojiByName("CONTROL.UP", "id")) |
| 126 | .setLabel("Move up") |
| 127 | .setCustomId("promote") |
TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 128 | .setStyle(ButtonStyle.Success) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 129 | .setDisabled( |
| 130 | conflict || |
| 131 | currentRoleIndex === 0 || |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 132 | (currentRoleIndex === -1 ? false : !allowed[currentRoleIndex - 1]) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 133 | ), |
TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 134 | new ButtonBuilder() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 135 | .setEmoji(getEmojiByName("CONTROL.DOWN", "id")) |
| 136 | .setLabel("Move down") |
| 137 | .setCustomId("demote") |
TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 138 | .setStyle(ButtonStyle.Danger) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 139 | .setDisabled( |
| 140 | conflict || |
| 141 | (data.nullable |
| 142 | ? currentRoleIndex <= -1 |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 143 | : currentRoleIndex === data.track.length - 1 || currentRoleIndex <= -1) || |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 144 | !allowed[currentRoleIndex] |
| 145 | ) |
| 146 | ]) |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 147 | ]) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 148 | })) as Message; |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 149 | let component: MessageComponentInteraction; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 150 | try { |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 151 | component = await m.awaitMessageComponent({ |
| 152 | time: 300000, |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 153 | filter: (i) => { return i.user.id === interaction.user.id && i.channel!.id === interaction.channel!.id && i.message.id === m.id } |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 154 | }); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 155 | } catch (e) { |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 156 | timedOut = true; |
| 157 | continue; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 158 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 159 | component.deferUpdate(); |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 160 | if (component.customId === "conflict") { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 161 | const rolesToRemove = selected.filter((role) => role !== (component as StringSelectMenuInteraction).values[0]); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 162 | await member.roles.remove(rolesToRemove); |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 163 | } else if (component.customId === "promote") { |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 164 | if ( |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 165 | currentRoleIndex === -1 |
| 166 | ? allowed[data.track.length - 1] |
| 167 | : allowed[currentRoleIndex - 1] && allowed[currentRoleIndex] |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 168 | ) { |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 169 | if (currentRoleIndex === -1) { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 170 | await member.roles.add(data.track[data.track.length - 1]!); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 171 | } else if (currentRoleIndex < data.track.length) { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 172 | if (!data.retainPrevious) await member.roles.remove(data.track[currentRoleIndex]!); |
| 173 | await member.roles.add(data.track[currentRoleIndex - 1]!); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 174 | } |
| 175 | } |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 176 | } else if (component.customId === "demote") { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 177 | if (allowed[currentRoleIndex]) { |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 178 | if (currentRoleIndex === data.track.length - 1) { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 179 | if (data.nullable) await member.roles.remove(data.track[currentRoleIndex]!); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 180 | } else if (currentRoleIndex > -1) { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 181 | await member.roles.remove(data.track[currentRoleIndex]!); |
| 182 | await member.roles.add(data.track[currentRoleIndex + 1]!); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 183 | } |
| 184 | } |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame] | 185 | } else if (component.customId === "select") { |
PineaFan | 638eb13 | 2023-01-19 10:41:22 +0000 | [diff] [blame] | 186 | track = parseInt((component as StringSelectMenuInteraction).values[0]!); |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 187 | } |
| 188 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 189 | }; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 190 | |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 191 | const check = async (interaction: CommandInteraction, _partial: boolean = false) => { |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 192 | const tracks = (await client.database.guilds.read(interaction.guild!.id)).tracks; |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 193 | if (tracks.length === 0) return "This server does not have any tracks"; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 194 | const member = interaction.member as GuildMember; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 195 | // Allow the owner to promote anyone |
TheCodedProf | 2ec2ba6 | 2023-01-18 22:26:20 -0500 | [diff] [blame] | 196 | if (member.id === interaction.guild!.ownerId) return true; |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 197 | // Check if the user can manage any of the tracks |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 198 | let managed = false; |
PineaFan | 638eb13 | 2023-01-19 10:41:22 +0000 | [diff] [blame] | 199 | const memberRoles = member.roles.cache.map((r) => r.id) |
pineafan | c1c1879 | 2022-08-03 21:41:36 +0100 | [diff] [blame] | 200 | for (const element of tracks) { |
PineaFan | 638eb13 | 2023-01-19 10:41:22 +0000 | [diff] [blame] | 201 | if (!element.manageableBy.length) continue; |
| 202 | if (!element.manageableBy.some((role: string) => memberRoles.includes(role))) continue; |
pineafan | c1c1879 | 2022-08-03 21:41:36 +0100 | [diff] [blame] | 203 | managed = true; |
| 204 | break; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 205 | } |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 206 | // Check if the user has manage_roles permission |
Samuel Shuert | 27bf3cd | 2023-03-03 15:51:25 -0500 | [diff] [blame] | 207 | if (!managed && !member.permissions.has("ManageRoles")) return "You do not have the *Manage Roles* permission"; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 208 | // Allow track |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 209 | return true; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 210 | }; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 211 | |
| 212 | export { command }; |
| 213 | export { callback }; |
pineafan | c6158ab | 2022-06-17 16:34:07 +0100 | [diff] [blame] | 214 | export { check }; |