useless slop

This commit is contained in:
nin0 2025-05-22 19:10:38 -04:00
parent 069400233a
commit 3fb6b6e2c2
Signed by: nin0
SSH key fingerprint: SHA256:NOoDnFVvZNFvqfXCIhzr6oCTDImZAbTTuyAysZ8Ufk8
6 changed files with 21 additions and 14 deletions

View file

@ -23,7 +23,7 @@ await build({
target: "esnext", target: "esnext",
logLevel: "info", logLevel: "info",
outfile: "dist/index.js", outfile: "dist/index.js",
minify: true, minify: !process.argv.includes("start"),
treeShaking: true, // shake it off shake it offff treeShaking: true, // shake it off shake it offff
jsx: "transform", jsx: "transform",
inject: ["components-jsx/runtime.ts"], inject: ["components-jsx/runtime.ts"],

View file

@ -2,12 +2,17 @@ import { ComponentTypes, ContainerComponent } from "oceanic.js";
import { childrenToArray } from "./utils"; import { childrenToArray } from "./utils";
export type ContainerProps = Omit<ContainerComponent, "type" | "components"> & { children: ContainerComponent["components"]; }; export type ContainerProps = Omit<ContainerComponent, "type" | "components"> & {
children: ContainerComponent["components"];
};
export function Container({ children, ...props }: ContainerProps): ContainerComponent { export function Container({
return { children,
type: ComponentTypes.CONTAINER, ...props
components: childrenToArray(children), }: ContainerProps): ContainerComponent {
...props return {
}; type: ComponentTypes.CONTAINER,
components: childrenToArray(children),
...props
};
} }

View file

@ -3,10 +3,10 @@ import { client } from "..";
import { Thumbnail } from "components-jsx/Thumbnail"; import { Thumbnail } from "components-jsx/Thumbnail";
import { TextDisplay } from "components-jsx/TextDisplay"; import { TextDisplay } from "components-jsx/TextDisplay";
import { br } from "components-jsx/br"; import { br } from "components-jsx/br";
import { User as DiscordUser } from "oceanic.js";
export async function User(props: { id: string }) { export function User(props: { user: DiscordUser }) {
const user = await client.rest.users.get(props.id); const { user } = props;
return ( return (
<Section <Section
accessory={ accessory={

View file

@ -11,7 +11,7 @@ export async function openDb() {
db.exec( db.exec(
`CREATE TABLE IF NOT EXISTS applications ( `CREATE TABLE IF NOT EXISTS applications (
id TEXT PRIMARY KEY, id TEXT,
user_id TEXT, user_id TEXT,
status INTEGER, status INTEGER,
responses TEXT, responses TEXT,

View file

@ -2,7 +2,6 @@ import { AllIntents, Client, ComponentTypes, MessageFlags } from "oceanic.js";
import { selfappReq } from "./selfappReq"; import { selfappReq } from "./selfappReq";
import { setupJoinRequestHandler } from "./joinRequestHandler"; import { setupJoinRequestHandler } from "./joinRequestHandler";
import { Constants } from "./Constants"; import { Constants } from "./Constants";
import { Divider, generateList, generateUserComponent, Header } from "./cv2";
import { openDb } from "./database"; import { openDb } from "./database";
export const client = new Client({ export const client = new Client({

View file

@ -60,6 +60,9 @@ export async function setupJoinRequestHandler(shard: Shard) {
application.message_id application.message_id
); );
} }
const user = await client.rest.users.get(
applicationData.user_id
);
await client.rest.channels.createMessage( await client.rest.channels.createMessage(
Constants.REJECTION_CHANNEL_ID, Constants.REJECTION_CHANNEL_ID,
<ComponentMessage> <ComponentMessage>
@ -68,7 +71,7 @@ export async function setupJoinRequestHandler(shard: Shard) {
## Join request withdrawn ## Join request withdrawn
</TextDisplay> </TextDisplay>
<Divider /> <Divider />
<User id={applicationData.user_id} /> <User user={user} />
<Divider /> <Divider />
<TextDisplay>### Application</TextDisplay> <TextDisplay>### Application</TextDisplay>
{application ? ( {application ? (