feat: new tags, fix: tag suggestion

This commit is contained in:
xHyroM 2022-07-10 22:43:14 +02:00
parent 031b129654
commit 7710f9c6bd
3 changed files with 32 additions and 11 deletions

View file

@ -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)
"""

View file

@ -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)

View file

@ -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({