mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-12-23 04:31:06 +01:00
feat: new tags, fix: tag suggestion
This commit is contained in:
parent
031b129654
commit
7710f9c6bd
3 changed files with 32 additions and 11 deletions
|
@ -23,4 +23,29 @@ content = """
|
|||
Any idea what to add to bun?
|
||||
• Please consider if this is a request for bun, not for other 3rd party packages
|
||||
• [Open an issue on GitHub](<https://github.com/oven-sh/bun/issues/new?template=2-feature-request.yml>) and fill out the given template
|
||||
"""
|
||||
|
||||
[hono]
|
||||
keywords = ["express", "server", "routes"]
|
||||
content = """
|
||||
**Hono - [炎] means flame🔥 in Japanese**
|
||||
• Is a small, simple, and ultrafast web framework for Cloudflare Workers, Deno, Bun, and others
|
||||
|
||||
[Bun doesn't currently support express because some native modules are missing, but you can use hono for now.](<https://github.com/honojs/hono#bun>)
|
||||
"""
|
||||
|
||||
[not-same-file-system]
|
||||
keywords = ["backend copyfile", "copyfile"]
|
||||
content = """
|
||||
**error: NotSameFileSystem installing [package]**
|
||||
|
||||
Bun uses hardlinks for installation by default.
|
||||
Due to technical limitations, hardlinks won't work with different partitions, to evade this limitation, use the `--backend=copyfile` flag.
|
||||
"""
|
||||
|
||||
[windows]
|
||||
keywords = ["windows support"]
|
||||
content = """
|
||||
Bun does not currently have support for Windows, so you must use WSL (Windows Subsystem for Linux).
|
||||
To install WSL, check [microsoft documentation](https://docs.microsoft.com/en-us/windows/wsl/install)
|
||||
"""
|
|
@ -24,7 +24,7 @@ new Command({
|
|||
],
|
||||
run: (ctx) => {
|
||||
const query: APIApplicationCommandInteractionDataStringOption = ctx.options[0] as APIApplicationCommandInteractionDataStringOption;
|
||||
const target = ctx?.resolved?.users?.[0];
|
||||
const target = ctx?.resolved?.users ? Object.values(ctx?.resolved?.users)[0] : null;
|
||||
|
||||
const tag = getTag(query.value);
|
||||
if (!tag)
|
||||
|
|
16
src/index.ts
16
src/index.ts
|
@ -61,16 +61,12 @@ app.post('/interaction', bodyParse(), async(c) => {
|
|||
}
|
||||
|
||||
if (interaction.type === InteractionType.ApplicationCommand && interaction.data.type === ApplicationCommandType.ChatInput) {
|
||||
try {
|
||||
return await Commands.get(interaction.data.name).run(new CommandContext(
|
||||
c,
|
||||
interaction.member,
|
||||
interaction.data.options,
|
||||
interaction.data.resolved
|
||||
));
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
}
|
||||
return await Commands.get(interaction.data.name).run(new CommandContext(
|
||||
c,
|
||||
interaction.member,
|
||||
interaction.data.options,
|
||||
interaction.data.resolved
|
||||
));
|
||||
}
|
||||
|
||||
return new CommandContext(c).respond({
|
||||
|
|
Loading…
Reference in a new issue