Initial Commit

This commit is contained in:
JB
2025-10-06 23:31:31 -04:00
commit 0c8630b8ba
243 changed files with 166945 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import type { CommandHandler } from '@/commands/command-handler.type';
const handler: CommandHandler<{ name: string; type: 1; description: string }> = {
definition: { name: 'test1', type: 1, description: 'Test command 1' },
execute: async () => {},
};
export default handler;

View File

@@ -0,0 +1,8 @@
import type { CommandHandler } from '@/commands/command-handler.type';
const handler: CommandHandler<{ name: string; type: 1; description: string }> = {
definition: { name: 'test2', type: 1, description: 'Test command 2' },
execute: async () => {},
};
export default handler;

View File

@@ -0,0 +1,21 @@
import * as StarKitten from '@star-kitten/discord';
import type { ExecutableInteraction } from '@star-kitten/discord';
import { createActionRow, createButton, createContainer, createTextDisplay } from '@star-kitten/discord/components';
import type { PageContext } from '@star-kitten/discord/pages';
import { type Appraisal } from '@star-kitten/eve/third-party/janice.js';
import { formatNumberToShortForm } from '@star-kitten/util/text.js';
export function renderAppraisal(
appraisal: Appraisal,
pageCtx: PageContext<any>,
interaction: ExecutableInteraction,
) {
const formatter = new Intl.NumberFormat(interaction.locale || 'en-US', {
maximumFractionDigits: 2,
minimumFractionDigits: 2,
});
const world = 'world';
return (
StarKitten.createElement("ActionRow", {}, StarKitten.createElement("Container", {"color":"0x1da57a"}, StarKitten.createElement("TextDisplay", {}, ""+ `Hello ${world}` +""), pageCtx.state.currentPage !== "share" ? StarKitten.createElement("ActionRow", {}, StarKitten.createElement("Button", {"key":"share","disabled":"{!unknown}"}, "Share in Channel")) : undefined))
)
}

View File

@@ -0,0 +1,29 @@
import type {} from '@star-kitten/discord/jsx';
import { ActionRow, Container, Button, TextDisplay } from '@star-kitten/discord';
export function renderAppraisal() {
const formatter = new Intl.NumberFormat('en-US', {
maximumFractionDigits: 2,
minimumFractionDigits: 2,
});
const world = 'world';
const rand = Math.random() * 1000;
const pageCtx = { state: { currentPage: 'home' } };
let jsx = (
<ActionRow>
<Container color="0x1da57a">
<TextDisplay content={`Hello ${world}`} />
{pageCtx.state.currentPage !== 'share' ?
<ActionRow>
<Button customId="share" label="Share in Channel" disabled={rand < 500} />
</ActionRow>
: undefined}
</Container>
</ActionRow>
);
console.log(jsx);
}
renderAppraisal();