pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 1 | import { LoadingEmbed } from "./../../utils/defaultEmbeds.js"; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 2 | import Discord, { |
| 3 | CommandInteraction, |
| 4 | GuildMember, |
| 5 | Message, |
| 6 | MessageActionRow, |
| 7 | MessageActionRowComponent, |
| 8 | MessageButton, |
| 9 | MessageComponentInteraction, |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 10 | MessageSelectOptionData, |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 11 | SelectMenuInteraction |
| 12 | } from "discord.js"; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 13 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
pineafan | 4edb776 | 2022-06-26 19:21:04 +0100 | [diff] [blame] | 14 | import EmojiEmbed from "../../utils/generateEmojiEmbed.js"; |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 15 | import getEmojiByName from "../../utils/getEmojiByName.js"; |
| 16 | import generateKeyValueList from "../../utils/generateKeyValueList.js"; |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 17 | import createPageIndicator from "../../utils/createPageIndicator.js"; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 18 | import client from "../../utils/client.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 19 | |
| 20 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 21 | builder |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 22 | .setName("about") |
| 23 | .setDescription("Shows info about a user") |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 24 | .addUserOption((option) => |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 25 | option.setName("user").setDescription("The user to get info about | Default: Yourself") |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 26 | ); |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 27 | |
| 28 | class Embed { |
| 29 | embed: Discord.MessageEmbed; |
| 30 | title: string; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 31 | description = ""; |
| 32 | pageId = 0; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 33 | setEmbed(embed: Discord.MessageEmbed) { |
| 34 | this.embed = embed; |
| 35 | return this; |
| 36 | } |
| 37 | setTitle(title: string) { |
| 38 | this.title = title; |
| 39 | return this; |
| 40 | } |
| 41 | setDescription(description: string) { |
| 42 | this.description = description; |
| 43 | return this; |
| 44 | } |
| 45 | setPageId(pageId: number) { |
| 46 | this.pageId = pageId; |
| 47 | return this; |
| 48 | } |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 49 | } |
| 50 | |
Skyler Grey | 1a67e18 | 2022-08-04 23:05:44 +0100 | [diff] [blame] | 51 | const callback = async (interaction: CommandInteraction): Promise<void> => { |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 52 | if (!interaction.guild) return; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 53 | const { renderUser, renderDelta } = client.logger; |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 54 | const member = (interaction.options.getMember("user") ?? interaction.member) as Discord.GuildMember; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 55 | const flags: string[] = []; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 56 | if ( |
| 57 | [ |
| 58 | "438733159748599813", // Pinea |
| 59 | "317731855317336067", // Mini |
| 60 | "261900651230003201", // Coded |
| 61 | "511655498676699136" // Zan |
| 62 | ].includes(member.user.id) |
| 63 | ) { |
| 64 | flags.push("NUCLEUSDEVELOPER"); |
| 65 | } |
| 66 | if ( |
| 67 | (await client.guilds.cache.get("684492926528651336")?.members.fetch()) |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 68 | ?.filter((m: GuildMember) => m.roles.cache.has("760896837866749972")) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 69 | ?.map((m: GuildMember) => m.id) |
| 70 | .includes(member.user.id) |
| 71 | ) { |
| 72 | flags.push("CLICKSDEVELOPER"); |
| 73 | } |
| 74 | member.user.flags.toArray().map((flag) => { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 75 | flags.push(flag.toString()); |
| 76 | }); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 77 | if (member.user.bot) { |
| 78 | flags.push("BOT"); |
| 79 | } |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 80 | // Check if they are boosting the server |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 81 | if (member.premiumSince) { |
| 82 | flags.push("BOOSTER"); |
| 83 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 84 | const nameReplacements = { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 85 | NUCLEUSDEVELOPER: "**Nucleus Developer**", |
| 86 | CLICKSDEVELOPER: "Clicks Developer", |
| 87 | HOUSE_BRAVERY: "Hypesquad Bravery", |
| 88 | HOUSE_BRILLIANCE: "Hypesquad Brilliance", |
| 89 | HOUSE_BALANCE: "Hypesquad Balance", |
| 90 | HYPESQUAD_EVENTS: "Hypesquad Events", |
| 91 | EARLY_SUPPORTER: "Early Supporter", |
| 92 | BUGHUNTER_LEVEL_1: "Bug Hunter Level 1", |
| 93 | BUGHUNTER_LEVEL_2: "Bug Hunter Level 2", |
| 94 | PARTNERED_SERVER_OWNER: "Partnered Server Owner", |
| 95 | DISCORD_EMPLOYEE: "Discord Staff", |
| 96 | EARLY_VERIFIED_BOT_DEVELOPER: "Verified Bot Developer", |
| 97 | BOT: "Bot", |
| 98 | BOOSTER: "Server Booster" |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 99 | }; |
| 100 | const members = await interaction.guild.members.fetch(); |
| 101 | const membersArray = [...members.values()]; |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 102 | membersArray.sort((a, b) => { |
| 103 | if (a.joinedTimestamp === null) return 1; |
| 104 | if (b.joinedTimestamp === null) return -1; |
| 105 | return a.joinedTimestamp - b.joinedTimestamp; |
| 106 | }); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 107 | const joinPos = membersArray.findIndex((m) => m.id === member.user.id); |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 108 | |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 109 | const roles = member.roles.cache.filter((r) => r.id !== interaction.guild!.id).sort(); |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 110 | let s = ""; |
| 111 | let count = 0; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 112 | let ended = false; |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 113 | for (const roleId in roles) { |
| 114 | const string = `<@&${roleId}>, `; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 115 | if (s.length + string.length > 1000) { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 116 | ended = true; |
| 117 | s += `and ${roles.size - count} more`; |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 118 | break; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 119 | } |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 120 | count++; |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 121 | s += string; |
Skyler Grey | c634e2b | 2022-08-06 17:50:48 +0100 | [diff] [blame] | 122 | } |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 123 | if (s.length > 0 && !ended) s = s.slice(0, -2); |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 124 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 125 | let perms = ""; |
| 126 | const permsArray = { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 127 | ADMINISTRATOR: "Administrator", |
| 128 | MANAGE_GUILD: "Manage Server", |
| 129 | MANAGE_ROLES: "Manage Roles", |
| 130 | MANAGE_CHANNELS: "Manage Channels", |
| 131 | KICK_MEMBERS: "Kick Members", |
| 132 | BAN_MEMBERS: "Ban Members", |
| 133 | MODERATE_MEMBERS: "Moderate Members", |
| 134 | MANAGE_NICKNAMES: "Manage Nicknames", |
| 135 | MANAGE_WEBHOOKS: "Manage Webhooks", |
| 136 | MANAGE_MESSAGES: "Manage Messages", |
| 137 | VIEW_AUDIT_LOG: "View Audit Log", |
| 138 | MENTION_EVERYONE: "Mention Everyone" |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 139 | }; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 140 | Object.keys(permsArray).map((perm) => { |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 141 | const hasPerm = member.permissions.has(perm as Discord.PermissionString); |
| 142 | perms += `${getEmojiByName("CONTROL." + (hasPerm ? "TICK" : "CROSS"))} ${permsArray[perm]}\n`; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 143 | }); |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 144 | |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 145 | let selectPaneOpen = false; |
| 146 | |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 147 | const embeds = [ |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 148 | new Embed() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 149 | .setEmbed( |
| 150 | new EmojiEmbed() |
| 151 | .setTitle("User Info: General") |
| 152 | .setStatus("Success") |
| 153 | .setEmoji("MEMBER.JOIN") |
| 154 | .setDescription( |
| 155 | flags |
| 156 | .map((flag) => { |
| 157 | if (nameReplacements[flag]) { |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 158 | return getEmojiByName(`BADGES.${flag}`) + " " + nameReplacements[flag]; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 159 | } |
| 160 | }) |
| 161 | .join("\n") + |
| 162 | "\n\n" + |
| 163 | generateKeyValueList({ |
| 164 | member: renderUser(member.user), |
pineafan | 3a02ea3 | 2022-08-11 21:35:04 +0100 | [diff] [blame] | 165 | nickname: member.nickname ?? "*None set*", |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 166 | id: `\`${member.id}\``, |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 167 | "joined the server": renderDelta(member.joinedTimestamp), |
| 168 | "joined discord": renderDelta(member.user.createdTimestamp), |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 169 | "boost status": member.premiumSince |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 170 | ? `Started boosting ${renderDelta(member.premiumSinceTimestamp)}` |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 171 | : "*Not boosting*", |
| 172 | "join position": `${joinPos + 1}` |
| 173 | }) |
| 174 | ) |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 175 | .setThumbnail(member.user.displayAvatarURL({ dynamic: true })) |
| 176 | .setImage((await member.user.fetch()).bannerURL({ format: "gif" })) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 177 | ) |
| 178 | .setTitle("General") |
| 179 | .setDescription("General information about the user") |
| 180 | .setPageId(0), |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 181 | new Embed() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 182 | .setEmbed( |
| 183 | new EmojiEmbed() |
| 184 | .setTitle("User Info: Roles") |
| 185 | .setStatus("Success") |
| 186 | .setEmoji("GUILD.ROLES.CREATE") |
| 187 | .setDescription( |
| 188 | generateKeyValueList({ |
| 189 | member: renderUser(member.user), |
| 190 | id: `\`${member.id}\``, |
| 191 | roles: `${member.roles.cache.size - 1}` |
| 192 | }) + |
| 193 | "\n" + |
| 194 | (s.length > 0 ? s : "*None*") + |
| 195 | "\n" |
| 196 | ) |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 197 | .setThumbnail(member.user.displayAvatarURL({ dynamic: true })) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 198 | ) |
| 199 | .setTitle("Roles") |
| 200 | .setDescription("Roles the user has") |
| 201 | .setPageId(1), |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 202 | new Embed() |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 203 | .setEmbed( |
| 204 | new EmojiEmbed() |
| 205 | .setTitle("User Info: Key Permissions") |
| 206 | .setStatus("Success") |
| 207 | .setEmoji("GUILD.ROLES.CREATE") |
| 208 | .setDescription( |
| 209 | generateKeyValueList({ |
| 210 | member: renderUser(member.user), |
| 211 | id: `\`${member.id}\`` |
| 212 | }) + |
| 213 | "\n" + |
| 214 | perms |
| 215 | ) |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 216 | .setThumbnail(member.user.displayAvatarURL({ dynamic: true })) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 217 | ) |
| 218 | .setTitle("Key Permissions") |
| 219 | .setDescription("Key permissions the user has") |
| 220 | .setPageId(2) |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 221 | ]; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 222 | const m = (await interaction.reply({ |
| 223 | embeds: LoadingEmbed, |
| 224 | fetchReply: true, |
| 225 | ephemeral: true |
| 226 | })) as Message; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 227 | let page = 0; |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 228 | let timedOut = false; |
| 229 | while (!timedOut) { |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 230 | const em = new Discord.MessageEmbed(embeds[page].embed); |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 231 | em.setDescription(em.description + "\n" + createPageIndicator(embeds.length, page)); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 232 | let selectPane = []; |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 233 | |
| 234 | if (selectPaneOpen) { |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 235 | const options: MessageSelectOptionData[] = []; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 236 | embeds.forEach((embed) => { |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 237 | options.push({ |
| 238 | label: embed.title, |
| 239 | value: embed.pageId.toString(), |
| 240 | description: embed.description || "" |
| 241 | }); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 242 | }); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 243 | selectPane = [ |
| 244 | new MessageActionRow().addComponents([ |
| 245 | new Discord.MessageSelectMenu() |
| 246 | .addOptions(options) |
| 247 | .setCustomId("page") |
| 248 | .setMaxValues(1) |
| 249 | .setPlaceholder("Choose a page...") |
| 250 | ]) |
| 251 | ]; |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 252 | } |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 253 | await interaction.editReply({ |
pineafan | 34369e6 | 2022-05-18 16:52:37 +0100 | [diff] [blame] | 254 | embeds: [em], |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 255 | components: selectPane.concat([ |
| 256 | new MessageActionRow().addComponents([ |
| 257 | new MessageButton() |
| 258 | .setEmoji(getEmojiByName("CONTROL.LEFT", "id")) |
| 259 | .setStyle("SECONDARY") |
| 260 | .setCustomId("left") |
| 261 | .setDisabled(page === 0), |
| 262 | new MessageButton() |
| 263 | .setEmoji(getEmojiByName("CONTROL.MENU", "id")) |
| 264 | .setStyle(selectPaneOpen ? "PRIMARY" : "SECONDARY") |
| 265 | .setCustomId("select") |
| 266 | .setDisabled(false), |
| 267 | new MessageButton() |
| 268 | .setEmoji(getEmojiByName("CONTROL.RIGHT", "id")) |
| 269 | .setCustomId("right") |
| 270 | .setStyle("SECONDARY") |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 271 | .setDisabled(page === embeds.length - 1) |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 272 | ]) |
| 273 | ]) |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 274 | }); |
Skyler Grey | 1a67e18 | 2022-08-04 23:05:44 +0100 | [diff] [blame] | 275 | let i: MessageComponentInteraction; |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 276 | try { |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 277 | i = await m.awaitMessageComponent({ time: 300000 }); |
| 278 | } catch { |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 279 | timedOut = true; |
| 280 | continue; |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 281 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 282 | i.deferUpdate(); |
Skyler Grey | 1a67e18 | 2022-08-04 23:05:44 +0100 | [diff] [blame] | 283 | if ((i.component as MessageActionRowComponent).customId === "left") { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 284 | if (page > 0) page--; |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 285 | selectPaneOpen = false; |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 286 | } else if ((i.component as MessageActionRowComponent).customId === "right") { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 287 | if (page < embeds.length - 1) page++; |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 288 | selectPaneOpen = false; |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 289 | } else if ((i.component as MessageActionRowComponent).customId === "select") { |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 290 | selectPaneOpen = !selectPaneOpen; |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 291 | } else if ((i.component as MessageActionRowComponent).customId === "page") { |
Skyler Grey | 1a67e18 | 2022-08-04 23:05:44 +0100 | [diff] [blame] | 292 | page = parseInt((i as SelectMenuInteraction).values[0]); |
pineafan | ea06304 | 2022-05-19 19:08:44 +0100 | [diff] [blame] | 293 | selectPaneOpen = false; |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 294 | } |
| 295 | } |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 296 | const em = new Discord.MessageEmbed(embeds[page].embed); |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 297 | em.setDescription(em.description + "\n" + createPageIndicator(embeds.length, page) + " | Message closed"); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 298 | await interaction.editReply({ |
| 299 | embeds: [em], |
Skyler Grey | ad00217 | 2022-08-16 18:48:26 +0100 | [diff] [blame^] | 300 | components: [] |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 301 | }); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 302 | }; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 303 | |
Skyler Grey | 1a67e18 | 2022-08-04 23:05:44 +0100 | [diff] [blame] | 304 | const check = () => { |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 305 | return true; |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 306 | }; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 307 | |
| 308 | export { command }; |
| 309 | export { callback }; |
Skyler Grey | 1a67e18 | 2022-08-04 23:05:44 +0100 | [diff] [blame] | 310 | export { check }; |