Lioness100
Lioness100
Explore posts from servers
SIASapphire - Imagine a framework
Created by Lioness100 on 1/19/2025 in #sapphire-support
string-store & strings
I've been trying out string-store and it's a great utility, but it's becoming annoying to stringify everything (and it also makes my formatting look bad because a lot of times it forces prettier to wrap the lines). When I serialize a custom id, I have to do .setCustomId(store.serialize(Id.EditSomethingButton, ...).toString()), and when I just use a normal custom id, I have to do .setCustomId(Id.EditSomethingButton.toString()). I know this isn't a very big problem; should I just suck it up? (Or I would love a convenience method like serializeStr). Or is there a way to use an enum of strings for schema ids, even if they're just stringified numbers?
14 replies
SIASapphire - Imagine a framework
Created by Lioness100 on 5/26/2023 in #sapphire-support
Paginated messages page limit
To get around the 25 page limit, is there a way to have the class just send up to three select menus if needed, raising the max to 75?
5 replies
SIASapphire - Imagine a framework
Created by Lioness100 on 1/4/2023 in #sapphire-support
Message Components Disappearing?
9 replies
DIAdiscord.js - Imagine an app
Created by Lioness100 on 11/12/2022 in #djs-questions
Interaction type is too narrow
Currently the Interaction type is:
export type Interaction<Cached extends CacheType = CacheType> =
| ChatInputCommandInteraction<Cached>
| MessageContextMenuCommandInteraction<Cached>
| UserContextMenuCommandInteraction<Cached>
| SelectMenuInteraction<Cached>
| ButtonInteraction<Cached>
| AutocompleteInteraction<Cached>
| ModalSubmitInteraction<Cached>;
export type Interaction<Cached extends CacheType = CacheType> =
| ChatInputCommandInteraction<Cached>
| MessageContextMenuCommandInteraction<Cached>
| UserContextMenuCommandInteraction<Cached>
| SelectMenuInteraction<Cached>
| ButtonInteraction<Cached>
| AutocompleteInteraction<Cached>
| ModalSubmitInteraction<Cached>;
I'm creating a function that takes an Interaction as a parameter, but typescript is reporting errors because the type is too narrow. In my case, I'm trying to input a ContextMenuCommandInteraction, but the type requires either a MessageContextMenuCommandInteraction or UserContextMenuCommandInteraction. Is there any way to use a general ContextMenuCommandInteraction with passing it in like:
someFunction(interaction as MessageContextMenuCommandInteraction | UserContextMenuCommandInteraction);
someFunction(interaction as MessageContextMenuCommandInteraction | UserContextMenuCommandInteraction);
Every time?
7 replies