KB
KB
SIASapphire - Imagine a framework
Created by Xeno™ on 1/6/2024 in #sapphire-support
Autocomplete handling in subcommands
It's the same as a normal command, but instead of just checking the focused option you can check the subcommand and subcommand group too.
public override async autocompleteRun(interaction: Subcommand.AutocompleteInteraction) {
const subcommand = interaction.options.getSubcommand();

if (subcommand === 'first') {
// stuff
} else if (subcommand === 'second') {
// stuff
}
}
public override async autocompleteRun(interaction: Subcommand.AutocompleteInteraction) {
const subcommand = interaction.options.getSubcommand();

if (subcommand === 'first') {
// stuff
} else if (subcommand === 'second') {
// stuff
}
}
8 replies
SIASapphire - Imagine a framework
Created by HealthCareUSA on 12/30/2023 in #sapphire-support
Get message text from ContextMenuCommandInteraction
Works for me. Never realized there was a type guard for that though, neat.
13 replies
SIASapphire - Imagine a framework
Created by HealthCareUSA on 12/30/2023 in #sapphire-support
Get message text from ContextMenuCommandInteraction
The true just means its required (ie can't be null)
13 replies
SIASapphire - Imagine a framework
Created by HealthCareUSA on 12/30/2023 in #sapphire-support
Get message text from ContextMenuCommandInteraction
If I remember correctly, you get it like so:
const message = interaction.options.getMessage('message', true);
const message = interaction.options.getMessage('message', true);
13 replies
SIASapphire - Imagine a framework
Created by Ravelt on 12/27/2023 in #sapphire-support
Subcommand Organization
It would work, yeah
11 replies
SIASapphire - Imagine a framework
Created by Oreo ™ on 12/11/2023 in #sapphire-support
API Authentication not working
23 replies
SIASapphire - Imagine a framework
Created by Oreo ™ on 12/11/2023 in #sapphire-support
API Authentication not working
@Oreo ™ Try using the fetch on the event object from the params. It's SvelteKit's special fetch that can include credentials and such.
import type { Handle } from '@sveltejs/kit';

export const handle: Handle = async ({ event, resolve }) => {
const { fetch } = event;

await fetch('https://example.com', {
method: 'GET'
});

return resolve(event);
};
import type { Handle } from '@sveltejs/kit';

export const handle: Handle = async ({ event, resolve }) => {
const { fetch } = event;

await fetch('https://example.com', {
method: 'GET'
});

return resolve(event);
};
23 replies
SIASapphire - Imagine a framework
Created by Saitama on 12/14/2023 in #sapphire-support
PaginatedMessage: How to disable footer?
Should be an easy PR
20 replies
SIASapphire - Imagine a framework
Created by Saitama on 12/14/2023 in #sapphire-support
PaginatedMessage: How to disable footer?
Yeah, checking it now and I don't think it can be outright excluded
20 replies
SIASapphire - Imagine a framework
Created by Mathias on 12/10/2023 in #sapphire-support
How to config baseUserDirectory
And just to note, it's not ready for the cjs/esm split. Gotta do that today. Should be good to go.
5 replies
SIASapphire - Imagine a framework
Created by Oreo ™ on 12/9/2023 in #sapphire-support
Setting up oauth API
Oh I didn't notice lol
89 replies
SIASapphire - Imagine a framework
Created by Oreo ™ on 12/9/2023 in #sapphire-support
Setting up oauth API
@Oreo ™ Here's a SvelteKit implementation you can check if it helps, though I haven't touched it in a while: https://github.com/KBot-discord/KBot/blob/main/apps/web/src/routes/(api)/oauth/discord/callback/%2Bserver.ts
89 replies
SIASapphire - Imagine a framework
Created by PossiblySebo on 12/4/2023 in #sapphire-support
Type issues with .addChoices()
Should create a new post if you have more questions, but you can find them on the Events export from @sapphire/framework
10 replies
SIASapphire - Imagine a framework
Created by PossiblySebo on 12/4/2023 in #sapphire-support
Type issues with .addChoices()
pepeCry
10 replies
SIASapphire - Imagine a framework
Created by PossiblySebo on 12/4/2023 in #sapphire-support
Type issues with .addChoices()
Dw I forget all the time
10 replies
SIASapphire - Imagine a framework
Created by PossiblySebo on 12/4/2023 in #sapphire-support
Type issues with .addChoices()
addChoices has a spread syntax for the array type, so remove the square brackets and it will work.
10 replies
SIASapphire - Imagine a framework
Created by paulandrew on 12/3/2023 in #sapphire-support
Error when creating a modal
You're not returning the none or some
14 replies
SIASapphire - Imagine a framework
Created by Caspian Nightworth on 11/26/2023 in #sapphire-support
Paginination limitation when not using select menus
Also, you can check the arguments from the original addPageEmbed to see the types.
22 replies
SIASapphire - Imagine a framework
Created by Caspian Nightworth on 11/26/2023 in #sapphire-support
Paginination limitation when not using select menus
Favna just said that
22 replies