mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-22 14:41:05 +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
|
@ -24,3 +24,28 @@ Any idea what to add to bun?
|
||||||
• Please consider if this is a request for bun, not for other 3rd party packages
|
• 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
|
• [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) => {
|
run: (ctx) => {
|
||||||
const query: APIApplicationCommandInteractionDataStringOption = ctx.options[0] as APIApplicationCommandInteractionDataStringOption;
|
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);
|
const tag = getTag(query.value);
|
||||||
if (!tag)
|
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) {
|
if (interaction.type === InteractionType.ApplicationCommand && interaction.data.type === ApplicationCommandType.ChatInput) {
|
||||||
try {
|
return await Commands.get(interaction.data.name).run(new CommandContext(
|
||||||
return await Commands.get(interaction.data.name).run(new CommandContext(
|
c,
|
||||||
c,
|
interaction.member,
|
||||||
interaction.member,
|
interaction.data.options,
|
||||||
interaction.data.options,
|
interaction.data.resolved
|
||||||
interaction.data.resolved
|
));
|
||||||
));
|
|
||||||
} catch(e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CommandContext(c).respond({
|
return new CommandContext(c).respond({
|
||||||
|
|
Loading…
Reference in a new issue