Favna
SIASapphire - Imagine a framework
•Created by Seraphim on 1/14/2025 in #sapphire-support
Re-registering Command Within Scope of chatInputRun
I would first try doing it through discordjs' client.application.commands but if that doesn't suffice or you want to be lazy then I believe from the top of my head you can also just call .load() on the specific command as opposed to loading all because I'm pretty sure load all does just that but in a for loop.
Other than that though, you are on the right track. Yours is a bit of an edge case honestly.
What you can also consider is not limiting selection to options at all but instead providing an autoconplete. Yes autocomplete can be bypassed but you would handle that by checking if the input is valid and if it's not then asking for valid input through a string select menu. This is what I do @Dragonite as well. You can try /pokemon then type .. idk "pika" and it'll autosuggest Pikachu. But then if you type "/pokemon" and mash your keyboard and hit enter before the autocomplete populates you will get an ephemeral reply with a select menu with suggestions.
Since both autocomplete options and the ephemeral reply can be build up dynamically you circumvent the issue entirely.
6 replies
SIASapphire - Imagine a framework
•Created by Teixeira on 1/13/2025 in #discordjs-support
`ModalBuilder` validation error
At a glance I can't say where but
s.instance
checks if a class is instanceof an expected class so somewhere you are providing an invalid class instance.3 replies
SIASapphire - Imagine a framework
•Created by dan on 1/11/2025 in #sapphire-support
Precondition results
that is either a very old bug from like a year ago or more, or something is wrong somewhere and code to repro the error would be very much appreciated
9 replies
SIASapphire - Imagine a framework
•Created by dan on 1/11/2025 in #sapphire-support
Precondition results
It's very easy to handle precondition errors. Just create a listener called
<type of command>Denied
and the error is right there, no need to unwrap it or anything.
https://github.com/favware/bloombot/blob/main/src/listeners/commands/chatInputCommands/chatInputCommandDenied.ts
https://github.com/favware/bloombot/blob/main/src/lib/util/functions/deniedHelper.ts9 replies
SIASapphire - Imagine a framework
•Created by dan on 1/11/2025 in #sapphire-support
Precondition results
you could throw your own error and not use
this.error
yes but there really should be no reason to at all. I don't know what problem you were having but I've never faced such a problem.9 replies
SIASapphire - Imagine a framework
•Created by gitty on 1/11/2025 in #sapphire-support
Is it possible to add some sort of custom property to commands that can be checked in a precondition
Or alternatively and much easier https://github.com/favware/bloombot/blob/main/src/lib/extensions/BloomComand.ts
6 replies
SIASapphire - Imagine a framework
•Created by gitty on 1/11/2025 in #sapphire-support
Is it possible to add some sort of custom property to commands that can be checked in a precondition
Yes
https://github.com/skyra-project/skyra/blob/main/src/lib/structures/commands/SkyraCommand.ts
https://github.com/skyra-project/skyra/blob/main/src/preconditions/Administrator.ts
6 replies
SIASapphire - Imagine a framework
•Created by Mathias on 1/8/2025 in #sapphire-support
Disable slash command in MP
oh right that's a thing now too I forgot
8 replies
SIASapphire - Imagine a framework
•Created by Mathias on 1/8/2025 in #sapphire-support
Disable slash command in MP
they should be disabled in the sense that using them throws the bot to chatInputCommandDenied but they will still show up unless you do not use global registration of the commands but rather guild specific registration
8 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
it is not: https://github.com/sapphiredev/examples/blob/feb072724c73a7b1fc07f38d80280ecfc73d08cc/examples/with-typescript-complete/src/index.ts#L10-L12
but that's just a simple if check to add there
29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
I can't stress enough how the readme describes exactly what files are loaded when
29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
this
29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
it is recommended to use the env specific files but if you want to exclusively use
.env.local
more power to you 🤷29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
that's not what you asked. You asked if the generated files by the cli are affected by what your env is, that is a no. However that is unrelated to when you then run the bot, that's a completely different process.
29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
it isnt
29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
the readme describes it in detail
29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
.env.development
loads when NODE_ENV='development'
.env.production
loads whne NODE_ENV='production'
without .development
or .production
load either way
the local variants load at the same time, but are gitignored29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
anything
*.local
is gitignored29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
the templates use https://github.com/skyra-project/archid-components/tree/main/packages/env-utilities#skyraenv-utilities so you can read in that readme how it works. The short version is that with this setup the
.env
becomes what other people use .env.example
for sometimes.29 replies
SIASapphire - Imagine a framework
•Created by Shrewd 💫 on 12/25/2024 in #sapphire-support
sapphiredev/examples
https://github.com/sapphiredev/examples/blob/feb072724c73a7b1fc07f38d80280ecfc73d08cc/.gitignore#L26-L30
if you use @sapphire/cli to generate the code then this is inserted
29 replies