TheCodedProf | 21c0859 | 2022-09-13 14:14:43 -0400 | [diff] [blame] | 1 | import Discord, { CommandInteraction, GuildMember, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"; |
TheCodedProf | f86ba09 | 2023-01-27 17:10:07 -0500 | [diff] [blame] | 2 | import type { SlashCommandSubcommandBuilder } from "discord.js"; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 3 | import confirmationMessage from "../../utils/confirmationMessage.js"; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 4 | import EmojiEmbed from "../../utils/generateEmojiEmbed.js"; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 5 | import keyValueList from "../../utils/generateKeyValueList.js"; |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 6 | import { create, areTicketsEnabled } from "../../actions/createModActionTicket.js"; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 7 | import client from "../../utils/client.js"; |
TheCodedProf | 94ff6de | 2023-02-22 17:47:26 -0500 | [diff] [blame] | 8 | import getEmojiByName from "../../utils/getEmojiByName.js"; |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 9 | import { LinkWarningFooter } from "../../utils/defaults.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 10 | |
| 11 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 12 | builder |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 13 | .setName("warn") |
| 14 | .setDescription("Warns a user") |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 15 | .addUserOption((option) => option.setName("user").setDescription("The user to warn").setRequired(true)); |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 16 | |
pineafan | 3a02ea3 | 2022-08-11 21:35:04 +0100 | [diff] [blame] | 17 | const callback = async (interaction: CommandInteraction): Promise<unknown> => { |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 18 | if (interaction.guild === null) return; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 19 | const { log, NucleusColors, renderUser, entry } = client.logger; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 20 | // TODO:[Modals] Replace this with a modal |
PineaFan | 100df68 | 2023-01-02 13:26:08 +0000 | [diff] [blame] | 21 | let reason: string | null = null; |
pineafan | 02ba023 | 2022-07-24 22:16:15 +0100 | [diff] [blame] | 22 | let notify = true; |
| 23 | let createAppealTicket = false; |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 24 | let confirmation; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 25 | let timedOut = false; |
| 26 | let success = false; |
pineafan | 62ce192 | 2022-08-25 20:34:45 +0100 | [diff] [blame] | 27 | do { |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 28 | confirmation = await new confirmationMessage(interaction) |
| 29 | .setEmoji("PUNISH.WARN.RED") |
| 30 | .setTitle("Warn") |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 31 | .setDescription( |
| 32 | keyValueList({ |
PineaFan | 100df68 | 2023-01-02 13:26:08 +0000 | [diff] [blame] | 33 | user: renderUser(interaction.options.getUser("user")!), |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 34 | reason: reason ? "\n> " + reason.replaceAll("\n", "\n> ") : "*No reason provided*" |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 35 | }) + `Are you sure you want to warn <@!${(interaction.options.getMember("user") as GuildMember).id}>?` |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 36 | ) |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 37 | .setColor("Danger") |
| 38 | .addCustomBoolean( |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 39 | "appeal", |
| 40 | "Create appeal ticket", |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 41 | !(await areTicketsEnabled(interaction.guild.id)), |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 42 | async () => |
| 43 | await create(interaction.guild!, interaction.options.getUser("user")!, interaction.user, reason), |
PineaFan | 100df68 | 2023-01-02 13:26:08 +0000 | [diff] [blame] | 44 | "An appeal ticket will be created", |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 45 | null, |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 46 | "CONTROL.TICKET", |
| 47 | createAppealTicket |
| 48 | ) |
| 49 | .addCustomBoolean( |
| 50 | "notify", |
| 51 | "Notify user", |
| 52 | false, |
| 53 | null, |
PineaFan | 100df68 | 2023-01-02 13:26:08 +0000 | [diff] [blame] | 54 | "The user will be sent a DM", |
PineaFan | a34d04b | 2023-01-03 22:05:42 +0000 | [diff] [blame] | 55 | null, |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 56 | "ICONS.NOTIFY." + (notify ? "ON" : "OFF"), |
| 57 | notify |
| 58 | ) |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 59 | .addReasonButton(reason ?? "") |
PineaFan | 1dee28f | 2023-01-16 22:09:07 +0000 | [diff] [blame] | 60 | .setFailedMessage("No changes were made", "Success", "PUNISH.WARN.GREEN") |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 61 | .send(reason !== null); |
| 62 | reason = reason ?? ""; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 63 | if (confirmation.cancelled) timedOut = true; |
pineafan | 62ce192 | 2022-08-25 20:34:45 +0100 | [diff] [blame] | 64 | else if (confirmation.success !== undefined) success = true; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 65 | else if (confirmation.newReason) reason = confirmation.newReason; |
| 66 | else if (confirmation.components) { |
PineaFan | 100df68 | 2023-01-02 13:26:08 +0000 | [diff] [blame] | 67 | notify = confirmation.components["notify"]!.active; |
| 68 | createAppealTicket = confirmation.components["appeal"]!.active; |
pineafan | 02ba023 | 2022-07-24 22:16:15 +0100 | [diff] [blame] | 69 | } |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 70 | } while (!timedOut && !success); |
PineaFan | e6ba788 | 2023-01-18 20:41:16 +0000 | [diff] [blame] | 71 | if (timedOut || !success) return; |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 72 | let dmSent = false; |
| 73 | const config = await client.database.guilds.read(interaction.guild.id); |
| 74 | try { |
| 75 | if (notify) { |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 76 | if (reason) { |
| 77 | reason = reason |
| 78 | .split("\n") |
| 79 | .map((line) => "> " + line) |
| 80 | .join("\n"); |
| 81 | } |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 82 | const messageData: { |
| 83 | embeds: EmojiEmbed[]; |
| 84 | components: ActionRowBuilder<ButtonBuilder>[]; |
| 85 | } = { |
| 86 | embeds: [ |
| 87 | new EmojiEmbed() |
| 88 | .setEmoji("PUNISH.WARN.RED") |
| 89 | .setTitle("Warned") |
| 90 | .setDescription( |
| 91 | `You have been warned in ${interaction.guild.name}` + |
PineaFan | 538d375 | 2023-01-12 21:48:23 +0000 | [diff] [blame] | 92 | (reason ? ` for:\n${reason}` : ".\n*No reason was provided*") + |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 93 | "\n\n" + |
| 94 | (createAppealTicket |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 95 | ? `You can appeal this in the ticket created in <#${ |
| 96 | confirmation.components!["appeal"]!.response |
| 97 | }>` |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 98 | : "") |
| 99 | ) |
| 100 | .setStatus("Danger") |
| 101 | ], |
| 102 | components: [] |
| 103 | }; |
| 104 | if (config.moderation.warn.text && config.moderation.warn.link) { |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 105 | messageData.embeds[0]!.setFooter(LinkWarningFooter); |
| 106 | messageData.components.push( |
| 107 | new ActionRowBuilder<Discord.ButtonBuilder>().addComponents( |
| 108 | new ButtonBuilder() |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 109 | .setStyle(ButtonStyle.Link) |
| 110 | .setLabel(config.moderation.warn.text) |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 111 | .setURL( |
| 112 | config.moderation.warn.link.replaceAll( |
| 113 | "{id}", |
| 114 | (interaction.options.getMember("user") as GuildMember).id |
| 115 | ) |
| 116 | ) |
| 117 | ) |
| 118 | ); |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 119 | } |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 120 | await (interaction.options.getMember("user") as GuildMember).send(messageData); |
| 121 | dmSent = true; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 122 | } |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 123 | } catch (e) { |
| 124 | dmSent = false; |
| 125 | } |
| 126 | const data = { |
| 127 | meta: { |
| 128 | type: "memberWarn", |
| 129 | displayName: "Member warned", |
| 130 | calculateType: "guildMemberPunish", |
| 131 | color: NucleusColors.yellow, |
| 132 | emoji: "PUNISH.WARN.YELLOW", |
TheCodedProf | 6ec331b | 2023-02-20 12:13:06 -0500 | [diff] [blame] | 133 | timestamp: Date.now() |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 134 | }, |
| 135 | list: { |
| 136 | user: entry( |
| 137 | (interaction.options.getMember("user") as GuildMember).user.id, |
| 138 | renderUser((interaction.options.getMember("user") as GuildMember).user) |
| 139 | ), |
| 140 | warnedBy: entry(interaction.member!.user.id, renderUser(interaction.member!.user as Discord.User)), |
TheCodedProf | 94ff6de | 2023-02-22 17:47:26 -0500 | [diff] [blame] | 141 | reason: reason ? reason : "*No reason provided*" |
| 142 | }, |
| 143 | separate: { |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 144 | end: |
| 145 | getEmojiByName("ICONS.NOTIFY." + (notify ? "ON" : "OFF")) + |
| 146 | ` The user was ${notify ? "" : "not "}notified` |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 147 | }, |
| 148 | hidden: { |
| 149 | guild: interaction.guild.id |
| 150 | } |
| 151 | }; |
| 152 | await client.database.history.create( |
| 153 | "warn", |
| 154 | interaction.guild.id, |
| 155 | (interaction.options.getMember("user") as GuildMember).user, |
| 156 | interaction.user, |
| 157 | reason |
| 158 | ); |
| 159 | log(data); |
| 160 | const failed = !dmSent && notify; |
| 161 | if (!failed) { |
| 162 | await interaction.editReply({ |
| 163 | embeds: [ |
| 164 | new EmojiEmbed() |
| 165 | .setEmoji("PUNISH.WARN.GREEN") |
| 166 | .setTitle("Warn") |
| 167 | .setDescription( |
| 168 | "The user was warned" + |
| 169 | (createAppealTicket |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 170 | ? ` and an appeal ticket was opened in <#${ |
| 171 | confirmation.components!["appeal"]!.response |
| 172 | }>` |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 173 | : "") |
| 174 | ) |
| 175 | .setStatus("Success") |
| 176 | ], |
| 177 | components: [] |
| 178 | }); |
| 179 | } else { |
| 180 | const canSeeChannel = (interaction.options.getMember("user") as GuildMember) |
| 181 | .permissionsIn(interaction.channel as Discord.TextChannel) |
| 182 | .has("ViewChannel"); |
| 183 | const m = (await interaction.editReply({ |
| 184 | embeds: [ |
| 185 | new EmojiEmbed() |
| 186 | .setEmoji("PUNISH.WARN.RED") |
| 187 | .setTitle("Warn") |
| 188 | .setDescription("The user's DMs are not open\n\nWhat would you like to do?") |
| 189 | .setStatus("Danger") |
| 190 | ], |
| 191 | components: [ |
| 192 | new ActionRowBuilder<Discord.ButtonBuilder>().addComponents( |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 193 | new Discord.ButtonBuilder() |
| 194 | .setCustomId("log") |
| 195 | .setLabel("Ignore and log") |
| 196 | .setStyle(ButtonStyle.Secondary), |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 197 | new Discord.ButtonBuilder() |
| 198 | .setCustomId("here") |
| 199 | .setLabel("Warn here") |
| 200 | .setStyle(canSeeChannel ? ButtonStyle.Primary : ButtonStyle.Secondary) |
| 201 | .setDisabled(!canSeeChannel), |
| 202 | new Discord.ButtonBuilder() |
| 203 | .setCustomId("ticket") |
| 204 | .setLabel("Create ticket") |
| 205 | .setStyle(canSeeChannel ? ButtonStyle.Primary : ButtonStyle.Secondary) |
| 206 | .setDisabled(createAppealTicket) |
| 207 | ) |
| 208 | ] |
| 209 | })) as Discord.Message; |
| 210 | let component; |
| 211 | try { |
| 212 | component = await m.awaitMessageComponent({ |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 213 | filter: (i) => |
| 214 | i.user.id === interaction.user.id && i.channel!.id === interaction.channel!.id && i.id === m.id, |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 215 | time: 300000 |
| 216 | }); |
| 217 | } catch (e) { |
| 218 | return await interaction.editReply({ |
| 219 | embeds: [ |
| 220 | new EmojiEmbed() |
| 221 | .setEmoji("PUNISH.WARN.GREEN") |
| 222 | .setTitle("Warn") |
| 223 | .setDescription("No changes were made") |
| 224 | .setStatus("Success") |
| 225 | ], |
| 226 | components: [] |
| 227 | }); |
| 228 | } |
| 229 | if (component.customId === "here") { |
| 230 | await interaction.channel!.send({ |
| 231 | embeds: [ |
| 232 | new EmojiEmbed() |
| 233 | .setEmoji("PUNISH.WARN.RED") |
| 234 | .setTitle("Warn") |
| 235 | .setDescription("You have been warned" + (reason ? ` for:\n> ${reason}` : ".")) |
| 236 | .setStatus("Danger") |
| 237 | ], |
| 238 | content: `<@!${(interaction.options.getMember("user") as GuildMember).id}>`, |
| 239 | allowedMentions: { |
| 240 | users: [(interaction.options.getMember("user") as GuildMember).id] |
| 241 | } |
| 242 | }); |
| 243 | return await interaction.editReply({ |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 244 | embeds: [ |
| 245 | new EmojiEmbed() |
| 246 | .setEmoji("PUNISH.WARN.GREEN") |
| 247 | .setTitle("Warn") |
| 248 | .setDescription( |
| 249 | "The user was warned" + |
PineaFan | 100df68 | 2023-01-02 13:26:08 +0000 | [diff] [blame] | 250 | (createAppealTicket |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 251 | ? ` and an appeal ticket was opened in <#${ |
| 252 | confirmation.components!["appeal"]!.response |
| 253 | }>` |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 254 | : "") |
| 255 | ) |
| 256 | .setStatus("Success") |
| 257 | ], |
| 258 | components: [] |
| 259 | }); |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 260 | } else if (component.customId === "log") { |
| 261 | await interaction.editReply({ |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 262 | embeds: [ |
| 263 | new EmojiEmbed() |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 264 | .setEmoji("PUNISH.WARN.GREEN") |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 265 | .setTitle("Warn") |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 266 | .setDescription("The warn was logged") |
| 267 | .setStatus("Success") |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 268 | ], |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 269 | components: [] |
| 270 | }); |
| 271 | } else if (component.customId === "ticket") { |
| 272 | const ticketChannel = await create( |
| 273 | interaction.guild, |
| 274 | interaction.options.getUser("user")!, |
| 275 | interaction.user, |
| 276 | reason, |
| 277 | "Warn Notification" |
| 278 | ); |
| 279 | if (ticketChannel === null) { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 280 | return await interaction.editReply({ |
| 281 | embeds: [ |
| 282 | new EmojiEmbed() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 283 | .setEmoji("PUNISH.WARN.RED") |
| 284 | .setTitle("Warn") |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 285 | .setDescription("A ticket could not be created") |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 286 | .setStatus("Danger") |
| 287 | ], |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 288 | components: [] |
| 289 | }); |
| 290 | } |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 291 | await interaction.editReply({ |
| 292 | embeds: [ |
| 293 | new EmojiEmbed() |
| 294 | .setEmoji("PUNISH.WARN.GREEN") |
| 295 | .setTitle("Warn") |
| 296 | .setDescription(`A ticket was created in <#${ticketChannel}>`) |
| 297 | .setStatus("Success") |
| 298 | ], |
| 299 | components: [] |
| 300 | }); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 301 | } |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 302 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 303 | }; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 304 | |
TheCodedProf | f86ba09 | 2023-01-27 17:10:07 -0500 | [diff] [blame] | 305 | const check = (interaction: CommandInteraction, partial: boolean = false) => { |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 306 | if (!interaction.guild) return; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 307 | const member = interaction.member as GuildMember; |
Skyler Grey | da16adf | 2023-03-05 10:22:12 +0000 | [diff] [blame^] | 308 | if (!member.permissions.has("ModerateMembers")) return "You do not have the *Moderate Members* permission"; |
| 309 | if (partial) return true; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 310 | const apply = interaction.options.getMember("user") as GuildMember | null; |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 311 | if (apply === null) return "That member is not in the server"; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame] | 312 | const memberPos = member.roles.cache.size ? member.roles.highest.position : 0; |
| 313 | const applyPos = apply.roles.cache.size ? apply.roles.highest.position : 0; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 314 | // Do not allow warning bots |
PineaFan | 0d06edc | 2023-01-17 22:10:31 +0000 | [diff] [blame] | 315 | if (member.user.bot) return "I cannot warn bots"; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 316 | // Allow the owner to warn anyone |
PineaFan | a00db1b | 2023-01-02 15:32:54 +0000 | [diff] [blame] | 317 | if (member.id === interaction.guild.ownerId) return true; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 318 | // Check if the user has moderate_members permission |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 319 | // Check if the user is below on the role list |
TheCodedProf | 0941da4 | 2023-02-18 20:28:04 -0500 | [diff] [blame] | 320 | if (!(memberPos > applyPos)) return `You do not have a role higher than <@${apply.id}>`; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 321 | // Allow warn |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 322 | return true; |
| 323 | }; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 324 | |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 325 | export { command, callback, check }; |