pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 1 | import Discord, { CommandInteraction, GuildChannel, GuildMember, TextChannel } from "discord.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 2 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
| 3 | import { WrappedCheck } from "jshaiku"; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 4 | import confirmationMessage from "../../utils/confirmationMessage.js"; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 5 | import EmojiEmbed from "../../utils/generateEmojiEmbed.js"; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 6 | import keyValueList from "../../utils/generateKeyValueList.js"; |
| 7 | import getEmojiByName from "../../utils/getEmojiByName.js"; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 8 | import client from "../../utils/client.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 9 | |
| 10 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 11 | builder |
| 12 | .setName("purge") |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 13 | .setDescription("Bulk deletes messages in a channel") |
| 14 | .addIntegerOption(option => option |
| 15 | .setName("amount") |
| 16 | .setDescription("The amount of messages to delete") |
| 17 | .setRequired(false) |
| 18 | .setMinValue(1) |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 19 | .setMaxValue(100)) |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 20 | .addUserOption(option => option.setName("user").setDescription("The user to purge messages from").setRequired(false)) |
| 21 | .addStringOption(option => option.setName("reason").setDescription("The reason for the purge").setRequired(false)) |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 22 | |
pineafan | 6702cef | 2022-06-13 17:52:37 +0100 | [diff] [blame] | 23 | const callback = async (interaction: CommandInteraction): Promise<any> => { |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 24 | let user = interaction.options.getMember("user") as GuildMember ?? null |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 25 | let channel = (interaction.channel as GuildChannel) |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 26 | if (!(["GUILD_TEXT", "GUILD_NEWS", "GUILD_NEWS_THREAD", "GUILD_PUBLIC_THREAD", "GUILD_PRIVATE_THREAD"].includes(channel.type.toString()))) { |
| 27 | return await interaction.reply({ |
| 28 | embeds: [ |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 29 | new EmojiEmbed() |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 30 | .setEmoji("CHANNEL.PURGE.RED") |
| 31 | .setTitle("Purge") |
| 32 | .setDescription("You cannot purge this channel") |
| 33 | .setStatus("Danger") |
| 34 | ], |
| 35 | components: [], |
| 36 | ephemeral: true, |
| 37 | }) |
| 38 | } |
| 39 | // TODO:[Modals] Replace this with a modal |
| 40 | if ( !interaction.options.getInteger("amount") ) { |
| 41 | await interaction.reply({ |
| 42 | embeds: [ |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 43 | new EmojiEmbed() |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 44 | .setEmoji("CHANNEL.PURGE.RED") |
| 45 | .setTitle("Purge") |
| 46 | .setDescription("Select how many messages to delete") |
| 47 | .setStatus("Danger") |
| 48 | ], |
| 49 | components: [], |
| 50 | ephemeral: true, |
| 51 | fetchReply: true |
| 52 | }) |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 53 | let deleted = [] as Discord.Message[] |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 54 | while (true) { |
| 55 | let m = await interaction.editReply({ |
| 56 | embeds: [ |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 57 | new EmojiEmbed() |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 58 | .setEmoji("CHANNEL.PURGE.RED") |
| 59 | .setTitle("Purge") |
| 60 | .setDescription("Select how many messages to delete. You can continue clicking until all messages are cleared.") |
| 61 | .setStatus("Danger") |
| 62 | ], |
| 63 | components: [ |
| 64 | new Discord.MessageActionRow().addComponents([ |
| 65 | new Discord.MessageButton() |
| 66 | .setCustomId("1") |
| 67 | .setLabel("1") |
| 68 | .setStyle("SECONDARY"), |
| 69 | new Discord.MessageButton() |
| 70 | .setCustomId("3") |
| 71 | .setLabel("3") |
| 72 | .setStyle("SECONDARY"), |
| 73 | new Discord.MessageButton() |
| 74 | .setCustomId("5") |
| 75 | .setLabel("5") |
| 76 | .setStyle("SECONDARY") |
| 77 | ]), |
| 78 | new Discord.MessageActionRow().addComponents([ |
| 79 | new Discord.MessageButton() |
| 80 | .setCustomId("10") |
| 81 | .setLabel("10") |
| 82 | .setStyle("SECONDARY"), |
| 83 | new Discord.MessageButton() |
| 84 | .setCustomId("25") |
| 85 | .setLabel("25") |
| 86 | .setStyle("SECONDARY"), |
| 87 | new Discord.MessageButton() |
| 88 | .setCustomId("50") |
| 89 | .setLabel("50") |
| 90 | .setStyle("SECONDARY") |
| 91 | ]), |
| 92 | new Discord.MessageActionRow().addComponents([ |
| 93 | new Discord.MessageButton() |
| 94 | .setCustomId("done") |
| 95 | .setLabel("Done") |
| 96 | .setStyle("SUCCESS") |
| 97 | .setEmoji(getEmojiByName("CONTROL.TICK", "id")) |
| 98 | ]) |
| 99 | ] |
| 100 | }) |
| 101 | let component; |
| 102 | try { |
pineafan | c6158ab | 2022-06-17 16:34:07 +0100 | [diff] [blame] | 103 | component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000}); |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 104 | } catch (e) { break; } |
| 105 | component.deferUpdate(); |
| 106 | if (component.customId === "done") break; |
| 107 | let amount; |
| 108 | try { amount = parseInt(component.customId); } catch { break; } |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 109 | let messages; |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 110 | await (interaction.channel as TextChannel).messages.fetch({limit: amount}).then(async (ms) => { |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 111 | if (user) { |
| 112 | ms = ms.filter(m => m.author.id === user.id) |
| 113 | } |
| 114 | messages = await (channel as TextChannel).bulkDelete(ms, true); |
| 115 | }) |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 116 | if (messages) { |
| 117 | deleted = deleted.concat(messages.map(m => m)) |
| 118 | } |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 119 | } |
| 120 | if (deleted.length === 0) return await interaction.editReply({ |
| 121 | embeds: [ |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 122 | new EmojiEmbed() |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 123 | .setEmoji("CHANNEL.PURGE.RED") |
| 124 | .setTitle("Purge") |
| 125 | .setDescription("No messages were deleted") |
| 126 | .setStatus("Danger") |
| 127 | ], |
| 128 | components: [] |
| 129 | }) |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 130 | if (user) { |
| 131 | try { await client.database.history.create("purge", interaction.guild.id, user, interaction.options.getString("reason"), null, null, deleted.length) } catch {} |
| 132 | } |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 133 | let attachmentObject; |
| 134 | try { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 135 | const { log, NucleusColors, entry, renderUser, renderChannel } = client.logger |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 136 | let data = { |
| 137 | meta: { |
| 138 | type: 'channelPurge', |
| 139 | displayName: 'Channel Purged', |
| 140 | calculateType: 'messageDelete', |
| 141 | color: NucleusColors.red, |
| 142 | emoji: "PUNISH.BAN.RED", |
| 143 | timestamp: new Date().getTime() |
| 144 | }, |
| 145 | list: { |
pineafan | da6e534 | 2022-07-03 10:03:16 +0100 | [diff] [blame] | 146 | memberId: entry(interaction.user.id, `\`${interaction.user.id}\``), |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 147 | purgedBy: entry(interaction.user.id, renderUser(interaction.user)), |
| 148 | channel: entry(interaction.channel.id, renderChannel(interaction.channel)), |
| 149 | messagesCleared: entry(deleted.length, deleted.length), |
| 150 | }, |
| 151 | hidden: { |
| 152 | guild: interaction.guild.id |
| 153 | } |
| 154 | } |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 155 | log(data); |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 156 | let out = "" |
| 157 | deleted.reverse().forEach(message => { |
| 158 | out += `${message.author.username}#${message.author.discriminator} (${message.author.id}) [${new Date(message.createdTimestamp).toISOString()}]\n` |
| 159 | let lines = message.content.split("\n") |
| 160 | lines.forEach(line => {out += `> ${line}\n`}) |
| 161 | out += `\n\n` |
| 162 | }) |
| 163 | attachmentObject = { |
| 164 | attachment: Buffer.from(out), |
| 165 | name: `purge-${channel.id}-${Date.now()}.txt`, |
| 166 | description: "Purge log" |
| 167 | } |
| 168 | } catch {} |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 169 | let m = await interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 170 | .setEmoji(`CHANNEL.PURGE.GREEN`) |
| 171 | .setTitle(`Purge`) |
| 172 | .setDescription("Messages cleared") |
| 173 | .setStatus("Success") |
| 174 | ], components: [new Discord.MessageActionRow().addComponents([ |
| 175 | new Discord.MessageButton() |
| 176 | .setCustomId("download") |
| 177 | .setLabel("Download transcript") |
| 178 | .setStyle("SUCCESS") |
| 179 | .setEmoji(getEmojiByName("CONTROL.DOWNLOAD", "id")) |
| 180 | ])]}) |
| 181 | let component; |
| 182 | try { |
pineafan | c6158ab | 2022-06-17 16:34:07 +0100 | [diff] [blame] | 183 | component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000}); |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 184 | } catch {} |
| 185 | if (component && component.customId === "download") { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 186 | interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 187 | .setEmoji("CHANNEL.PURGE.GREEN") |
| 188 | .setTitle(`Purge`) |
| 189 | .setDescription("Uploaded") |
| 190 | .setStatus("Success") |
| 191 | ], components: [], files: [attachmentObject]}) |
| 192 | } else { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 193 | interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 194 | .setEmoji("CHANNEL.PURGE.GREEN") |
| 195 | .setTitle(`Purge`) |
| 196 | .setDescription("Messages cleared") |
| 197 | .setStatus("Success") |
| 198 | ], components: []}) |
| 199 | } |
| 200 | return |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 201 | } else { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 202 | let confirmation = await new confirmationMessage(interaction) |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 203 | .setEmoji("CHANNEL.PURGE.RED") |
| 204 | .setTitle("Purge") |
| 205 | .setDescription(keyValueList({ |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 206 | "channel": `<#${channel.id}>`, |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 207 | "amount": interaction.options.getInteger("amount").toString(), |
| 208 | "reason": `\n> ${interaction.options.getString("reason") ? interaction.options.getString("reason") : "*No reason provided*"}` |
| 209 | })) |
| 210 | .setColor("Danger") |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 211 | .send() |
pineafan | 02ba023 | 2022-07-24 22:16:15 +0100 | [diff] [blame] | 212 | if (confirmation.cancelled) return |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 213 | if (confirmation.success) { |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 214 | let messages; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 215 | try { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 216 | if (!user) { |
| 217 | let toDelete = await (interaction.channel as TextChannel).messages.fetch({limit: interaction.options.getInteger("amount")}) |
| 218 | messages = await (channel as TextChannel).bulkDelete(toDelete, true); |
| 219 | } else { |
| 220 | let toDelete = (await (await (interaction.channel as TextChannel).messages.fetch({limit: 100})) |
| 221 | .filter(m => m.author.id === user.id)).first(interaction.options.getInteger("amount")) |
| 222 | messages = await (channel as TextChannel).bulkDelete(toDelete, true); |
| 223 | } |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 224 | } catch(e) { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 225 | await interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 226 | .setEmoji("CHANNEL.PURGE.RED") |
| 227 | .setTitle(`Purge`) |
| 228 | .setDescription("Something went wrong and no messages were deleted") |
| 229 | .setStatus("Danger") |
| 230 | ], components: []}) |
| 231 | } |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 232 | if (user) { |
| 233 | try { await client.database.history.create("purge", interaction.guild.id, user, interaction.options.getString("reason"), null, null, messages.size) } catch {} |
| 234 | } |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 235 | let attachmentObject; |
| 236 | try { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 237 | const { log, NucleusColors, entry, renderUser, renderChannel } = client.logger |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 238 | let data = { |
| 239 | meta: { |
| 240 | type: 'channelPurge', |
| 241 | displayName: 'Channel Purged', |
| 242 | calculateType: 'messageDelete', |
| 243 | color: NucleusColors.red, |
| 244 | emoji: "PUNISH.BAN.RED", |
| 245 | timestamp: new Date().getTime() |
| 246 | }, |
| 247 | list: { |
pineafan | da6e534 | 2022-07-03 10:03:16 +0100 | [diff] [blame] | 248 | memberId: entry(interaction.user.id, `\`${interaction.user.id}\``), |
pineafan | e625d78 | 2022-05-09 18:04:32 +0100 | [diff] [blame] | 249 | purgedBy: entry(interaction.user.id, renderUser(interaction.user)), |
| 250 | channel: entry(interaction.channel.id, renderChannel(interaction.channel)), |
| 251 | messagesCleared: entry(messages.size, messages.size), |
| 252 | }, |
| 253 | hidden: { |
| 254 | guild: interaction.guild.id |
| 255 | } |
| 256 | } |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 257 | log(data); |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 258 | let out = "" |
| 259 | messages.reverse().forEach(message => { |
| 260 | out += `${message.author.username}#${message.author.discriminator} (${message.author.id}) [${new Date(message.createdTimestamp).toISOString()}]\n` |
| 261 | let lines = message.content.split("\n") |
| 262 | lines.forEach(line => {out += `> ${line}\n`}) |
| 263 | out += `\n\n` |
| 264 | }) |
| 265 | attachmentObject = { |
| 266 | attachment: Buffer.from(out), |
| 267 | name: `purge-${channel.id}-${Date.now()}.txt`, |
| 268 | description: `Purge log` |
| 269 | } |
| 270 | } catch {} |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 271 | let m = await interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 272 | .setEmoji(`CHANNEL.PURGE.GREEN`) |
| 273 | .setTitle(`Purge`) |
| 274 | .setDescription("Messages cleared") |
| 275 | .setStatus("Success") |
| 276 | ], components: [new Discord.MessageActionRow().addComponents([ |
| 277 | new Discord.MessageButton() |
| 278 | .setCustomId("download") |
| 279 | .setLabel("Download transcript") |
| 280 | .setStyle("SUCCESS") |
| 281 | .setEmoji(getEmojiByName("CONTROL.DOWNLOAD", "id")) |
| 282 | ])]}) |
| 283 | let component; |
| 284 | try { |
pineafan | c6158ab | 2022-06-17 16:34:07 +0100 | [diff] [blame] | 285 | component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000}); |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 286 | } catch {} |
| 287 | if (component && component.customId === "download") { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 288 | interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 289 | .setEmoji("CHANNEL.PURGE.GREEN") |
| 290 | .setTitle(`Purge`) |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 291 | .setDescription("Transcript uploaded above") |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 292 | .setStatus("Success") |
| 293 | ], components: [], files: [attachmentObject]}) |
| 294 | } else { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 295 | interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 5d1908e | 2022-02-28 21:34:47 +0000 | [diff] [blame] | 296 | .setEmoji("CHANNEL.PURGE.GREEN") |
| 297 | .setTitle(`Purge`) |
| 298 | .setDescription("Messages cleared") |
| 299 | .setStatus("Success") |
| 300 | ], components: []}) |
| 301 | } |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 302 | } else { |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 303 | await interaction.editReply({embeds: [new EmojiEmbed() |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 304 | .setEmoji("CHANNEL.PURGE.GREEN") |
| 305 | .setTitle(`Purge`) |
| 306 | .setDescription("No changes were made") |
| 307 | .setStatus("Success") |
| 308 | ], components: []}) |
| 309 | } |
| 310 | } |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
pineafan | 663dc47 | 2022-05-10 18:13:47 +0100 | [diff] [blame] | 314 | let member = (interaction.member as GuildMember) |
PineappleFan | 5fe720d | 2022-05-19 12:01:49 +0100 | [diff] [blame] | 315 | let me = (interaction.guild.me as GuildMember) |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 316 | // Allow the owner to purge |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [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 manage_messages permission |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame^] | 319 | if (! member.permissions.has("MANAGE_MESSAGES")) throw "You do not have the *Manage Messages* permission"; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 320 | // Check if nucleus has the manage_messages permission |
pineafan | e23c4ec | 2022-07-27 21:56:27 +0100 | [diff] [blame^] | 321 | if (! me.permissions.has("MANAGE_MESSAGES")) throw "I do not have the *Manage Messages* permission"; |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 322 | // Allow warn |
| 323 | return true |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 324 | } |
| 325 | |
pineafan | 8b4b17f | 2022-02-27 20:42:52 +0000 | [diff] [blame] | 326 | export { command, callback, check }; |