Prosta4ok_ua
Prosta4ok_ua
SIASapphire - Imagine a framework
Created by Prosta4ok_ua on 2/2/2025 in #sapphire-support
How to get name&description (default and localized)?
Thanks, appreciate it!
15 replies
SIASapphire - Imagine a framework
Created by Prosta4ok_ua on 2/2/2025 in #sapphire-support
How to get name&description (default and localized)?
No description
15 replies
SIASapphire - Imagine a framework
Created by Prosta4ok_ua on 2/2/2025 in #sapphire-support
How to get name&description (default and localized)?
For example, I have this command: (without any decorators)https://gist.github.com/Prosta4okua/317ab84bc669a695510966ba8c10bdf5 And I want to create command /help that prints all commands and their descriptions. I want to support two languages. I know how to get locale from user, I know how to set the localization of the application command. I need a way to receive names and descriptions (including in other localization). Basically something like this: [ {command: {name: 'google', nameLocalization: {'uk': ...}, description: 'Desc', descriptionLocalization: {'uk': 'Desc in uk'}'}, ...] I have this command:
import { Command } from '@sapphire/framework';
import { Locale } from 'discord.js';
import { container } from '@sapphire/framework';
import { ApplyOptions } from '@sapphire/decorators';

@ApplyOptions<Command.Options>({
description: 'Shows a list of available commands'
})
export class HelpCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) => {
return builder
.setName('help')
.setNameLocalization(Locale.Ukrainian, 'допомога')
.setDescription('Shows a list of available commands')
.setDescriptionLocalization(Locale.Ukrainian, 'Показує список доступних команд');
},
{ idHints: ['1335626733210042408'] }
);
}

public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
let resultText = '';
const result = container.stores.get('commands');
result.map((command) => {
resultText += `${command.name} - ${command.options.description} | ${command.category} | ${command.options}\n`;
});

return interaction.reply(resultText);
}
}
import { Command } from '@sapphire/framework';
import { Locale } from 'discord.js';
import { container } from '@sapphire/framework';
import { ApplyOptions } from '@sapphire/decorators';

@ApplyOptions<Command.Options>({
description: 'Shows a list of available commands'
})
export class HelpCommand extends Command {
public override registerApplicationCommands(registry: Command.Registry) {
registry.registerChatInputCommand(
(builder) => {
return builder
.setName('help')
.setNameLocalization(Locale.Ukrainian, 'допомога')
.setDescription('Shows a list of available commands')
.setDescriptionLocalization(Locale.Ukrainian, 'Показує список доступних команд');
},
{ idHints: ['1335626733210042408'] }
);
}

public override async chatInputRun(interaction: Command.ChatInputCommandInteraction) {
let resultText = '';
const result = container.stores.get('commands');
result.map((command) => {
resultText += `${command.name} - ${command.options.description} | ${command.category} | ${command.options}\n`;
});

return interaction.reply(resultText);
}
}
15 replies
SIASapphire - Imagine a framework
Created by Prosta4ok_ua on 2/2/2025 in #sapphire-support
How to get name&description (default and localized)?
<command>.options.description still doesn't work for command description not in the decorators
15 replies
DTDrizzle Team
Created by Ganbatte on 2/1/2025 in #help
Is This SQL Query Efficient? Seeking Advice!
As far I understood, you need to fetch dish groups id. So you need to select only id of the dish group, inner join it to dish, inner join dish to the restaurant and that's it. You will get array of id.
3 replies
DTDrizzle Team
Created by Ganbatte on 2/1/2025 in #help
Is This SQL Query Efficient? Seeking Advice!
Hi there! You could use .toSQL() to see your query (don't forget to print it). Also, I do not recommend touching any ORM before learning SQL. Try to use raw SQL queries or maybe just don't use "with" in your query and use .innerJoin, .leftJoin etc. Try to understand what you're doing.
3 replies
SIASapphire - Imagine a framework
Created by iaqi on 11/30/2024 in #sapphire-support
application command registry saying it takes 40 seconds to initalise
oh, i maybe have the same problem 👀
54 replies
SIASapphire - Imagine a framework
Created by nijama.dev on 1/25/2025 in #sapphire-support
How to transpile TypeScript using Bun?
bun start in package.json:
"scripts": {
"start": "bun src/index.ts"
},
"scripts": {
"start": "bun src/index.ts"
},
12 replies
SIASapphire - Imagine a framework
Created by nijama.dev on 1/25/2025 in #sapphire-support
How to transpile TypeScript using Bun?
I'm using the latest Bun version and have no issues so far.
12 replies