From 612ed820a0600ec11ed642005377cd7f5a8a8b77 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 3 Oct 2022 22:57:40 -0400 Subject: wip --- lib/utils/Utils.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lib/utils/Utils.ts') diff --git a/lib/utils/Utils.ts b/lib/utils/Utils.ts index 13806ec..ea70abf 100644 --- a/lib/utils/Utils.ts +++ b/lib/utils/Utils.ts @@ -1,9 +1,11 @@ +import { Util as AkairoUtil } from '@notenoughupdates/discord-akairo'; import { humanizeDuration as humanizeDurationMod } from '@notenoughupdates/humanize-duration'; +import deepLock from '@tanzanite/deep-lock'; import assert from 'assert/strict'; import cp from 'child_process'; -import deepLock from 'deep-lock'; -import { Util as AkairoUtil } from 'discord-akairo'; import { + ActionRowBuilder, + APITextInputComponent, Constants as DiscordConstants, EmbedBuilder, Message, @@ -11,6 +13,8 @@ import { PermissionFlagsBits, PermissionsBitField, PermissionsString, + TextInputBuilder, + TextInputComponentData, type APIEmbed, type APIMessage, type CommandInteraction, @@ -159,7 +163,7 @@ export async function slashRespond( delete (newResponseOptions as InteractionReplyOptions).ephemeral; // Cannot change a preexisting message to be ephemeral return (await interaction.editReply(newResponseOptions)) as Message | APIMessage; } else { - await interaction.reply(newResponseOptions); + await interaction.reply(newResponseOptions as SlashSendMessageType); return await interaction.fetchReply().catch(() => undefined); } } @@ -547,3 +551,9 @@ export function deepWriteable(obj: T): DeepWritable { export function formatPerms(permissions: PermissionsString[]) { return permissions.map((p) => `\`${mappings.permissions[p]?.name ?? p}\``).join(', '); } + +export function ModalInput(options: Partial): ActionRowBuilder { + return new ActionRowBuilder({ + components: [new TextInputBuilder(options)] + }); +} -- cgit