mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
fix: type issues
This commit is contained in:
1 parent
7dd3913ae8
commit
abcb75f06e
4 files changed
+5
-5
No files matched your search
@@ -30,4 +30,4 @@ export default {
|
|||||||
const executionTime = Date.now() - executionStart;
|
const executionTime = Date.now() - executionStart;
|
||||||
interaction.editReply(`Pong 🏓 - ${executionTime}ms`);
|
interaction.editReply(`Pong 🏓 - ${executionTime}ms`);
|
||||||
},
|
},
|
||||||
} satisfies CommandRegistry;
|
} satisfies CommandRegistry<true>;
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
InteractionEditReplyOptions,
|
InteractionEditReplyOptions,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { InteractionReturnable } from '../../events/interactionCreate/index.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(
|
export default async function normalizeInteractionReturnable(
|
||||||
returnable: InteractionReturnable,
|
returnable: InteractionReturnable,
|
||||||
@@ -29,7 +29,7 @@ export default async function normalizeInteractionReturnable(
|
|||||||
item,
|
item,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const image = await render(item);
|
const image = await jsxToPng(item);
|
||||||
if (!reply.files) reply.files = [];
|
if (!reply.files) reply.files = [];
|
||||||
reply.files.push(image);
|
reply.files.push(image);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import jsxToSvg from './jsxToSvg.js';
|
import jsxToSvg from './jsxToSvg.js';
|
||||||
import svgToPng from './svgToPng.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 svg = await jsxToSvg(jsx);
|
||||||
const png = svgToPng(svg);
|
const png = svgToPng(svg);
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ export interface Registry {
|
|||||||
inProduction: boolean;
|
inProduction: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CommandRegistry<HandlesInteraction extends boolean = false>
|
export interface CommandRegistry<HandlesInteraction extends boolean = boolean>
|
||||||
extends Registry {
|
extends Registry {
|
||||||
inPublic: boolean;
|
inPublic: boolean;
|
||||||
handlesInteraction?: HandlesInteraction;
|
handlesInteraction?: HandlesInteraction;
|
||||||
|
|||||||
Reference in new issue
Block a user