From abcb75f06efe180cc5e6f289dd129729e042a918 Mon Sep 17 00:00:00 2001 From: tresabhi Date: Tue, 27 Jun 2023 01:48:26 +0000 Subject: [PATCH] fix: type issues --- src/commands/ping.ts | 2 +- src/core/discord/normalizeInteractionReturnable.ts | 4 ++-- src/core/node/{render.tsx => jsxToPng.ts} | 2 +- src/events/interactionCreate/index.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename src/core/node/{render.tsx => jsxToPng.ts} (72%) diff --git a/src/commands/ping.ts b/src/commands/ping.ts index 6c99eda61..bcff65f19 100644 --- a/src/commands/ping.ts +++ b/src/commands/ping.ts @@ -30,4 +30,4 @@ export default { const executionTime = Date.now() - executionStart; interaction.editReply(`Pong 🏓 - ${executionTime}ms`); }, -} satisfies CommandRegistry; +} satisfies CommandRegistry; diff --git a/src/core/discord/normalizeInteractionReturnable.ts b/src/core/discord/normalizeInteractionReturnable.ts index 9303aec47..d935763a3 100644 --- a/src/core/discord/normalizeInteractionReturnable.ts +++ b/src/core/discord/normalizeInteractionReturnable.ts @@ -5,7 +5,7 @@ import { InteractionEditReplyOptions, } from 'discord.js'; import { InteractionReturnable } from '../../events/interactionCreate/index.js'; -import render from '../ui/render.js'; +import jsxToPng from '../node/jsxToPng.js'; export default async function normalizeInteractionReturnable( returnable: InteractionReturnable, @@ -29,7 +29,7 @@ export default async function normalizeInteractionReturnable( item, ); } else { - const image = await render(item); + const image = await jsxToPng(item); if (!reply.files) reply.files = []; reply.files.push(image); } diff --git a/src/core/node/render.tsx b/src/core/node/jsxToPng.ts similarity index 72% rename from src/core/node/render.tsx rename to src/core/node/jsxToPng.ts index ae00848bc..e48d3b1f5 100644 --- a/src/core/node/render.tsx +++ b/src/core/node/jsxToPng.ts @@ -1,7 +1,7 @@ import jsxToSvg from './jsxToSvg.js'; import svgToPng from './svgToPng.js'; -export default async function render(jsx: JSX.Element) { +export default async function jsxToPng(jsx: JSX.Element) { const svg = await jsxToSvg(jsx); const png = svgToPng(svg); diff --git a/src/events/interactionCreate/index.ts b/src/events/interactionCreate/index.ts index 1594357df..4a7ef7b29 100644 --- a/src/events/interactionCreate/index.ts +++ b/src/events/interactionCreate/index.ts @@ -51,7 +51,7 @@ export interface Registry { inProduction: boolean; } -export interface CommandRegistry +export interface CommandRegistry extends Registry { inPublic: boolean; handlesInteraction?: HandlesInteraction;