diff --git a/packages/reacord/scripts/discordjs-manual-test.old.tsx b/packages/reacord/scripts/discordjs-manual-test.old.tsx deleted file mode 100644 index ccb4bf4..0000000 --- a/packages/reacord/scripts/discordjs-manual-test.old.tsx +++ /dev/null @@ -1,134 +0,0 @@ -import type { TextChannel } from "discord.js" -import { ChannelType, Client, IntentsBitField } from "discord.js" -import "dotenv/config" -import { kebabCase } from "lodash-es" -import * as React from "react" -import { useState } from "react" -import { - Button, - Option, - ReacordDiscordJs, - Select, - useInstance, -} from "../library/main" - -const client = new Client({ intents: IntentsBitField.Flags.Guilds }) -const reacord = new ReacordDiscordJs(client) - -await client.login(process.env.TEST_BOT_TOKEN) - -const guild = await client.guilds.fetch(process.env.TEST_GUILD_ID!) - -const category = await guild.channels.fetch(process.env.TEST_CATEGORY_ID!) -if (category?.type !== ChannelType.GuildCategory) { - throw new Error( - `channel ${process.env.TEST_CATEGORY_ID} is not a guild category. received ${category?.type}`, - ) -} - -for (const [, channel] of category.children.cache) { - await channel.delete() -} - -let prefix = 0 -const createTest = async ( - name: string, - block: (channel: TextChannel) => void | Promise, -) => { - prefix += 1 - const channel = await category.children.create({ - type: ChannelType.GuildText, - name: `${String(prefix).padStart(3, "0")}-${kebabCase(name)}`, - }) - await block(channel) -} - -await createTest("basic", (channel) => { - reacord.send(channel.id, "Hello, world!") -}) - -await createTest("counter", (channel) => { - const Counter = () => { - const [count, setCount] = React.useState(0) - return ( - <> - count: {count} -