sapphire-support
discordjs-support
old-sapphire-support
old-discordjs-support
old-application-commands-and-interactions
Did the latest @sapphire/[email protected] update break things?
Super preliminary stuff because I haven't bothered to debug it thoroughly;
It seems like the plugin doesn't import in my logs after running
pnpm update
. The typings for the i18n entry in SapphireClient also disappeared. Reverting to 5.0.4 seems to fix the issue. Has anyone else encountered this?...Spaced options with @sapphire/lexure
How do I get options that contains space? I tried add the options with quotes, but it doesn't work. Detailed code: https://runkit.com/zenshibata/sapphire-lexure-test
subcommand name
is there a way to get the name of the subcommand ran?
Solution:
Should be the same? As long as you have access to the interaction object
Registries behaviour
Can I override registries behaviour and register commands only in one guild? im moving from custom handler and don't want get guildId in every command
Async Preconditions
Helloo! It seems that I am unable to create a precondition that is async, whenever I try to write one with async. I get
The inferred type of 'chatInputRun' cannot be named without a reference to '.pnpm/@[email protected]/node_modules/@sapphire/result'. This is likely not portable. A type annotation is necessary.
Here is the code in question:
```ts
public override async chatInputRun(interaction: Interaction) {...Subcommand Preconditions Support
I've got the below code to create a command with subcommands and preconditions in ESM JS. My issue is that no matter what I seem to do, and I've had a look on the docs and had a look at the repo Favna linked here https://discord.com/channels/737141877803057244/1143510279024545864/1143541634248740955 , the preconditions on the subcommands never seem to be acknowledged, either in the precondition or the commands args.
```js
import { Subcommand } from '@sapphire/plugin-subcommands';
...
QUESTION
What is the difference between Sapphire Framework and discordjs what is the benefits between both two
Sample implementation of per-subcommand preconditions
Hello! Are there any examples on how would I be able to implement the new feature? And I suppose this supports both interaction and message preconditions? And would this be a better option instead of using precondition decorators? Thank you!
Error: Module did not self-register
I'm getting this error when I run my tests for some reason, how can I solve this?
```xl
Error when loading '/path/to/project/dist/commands/developer/eval.js': Error: Module did not self-register: '/path/to/project/node_modules/.pnpm/@[email protected]/node_modules/@sapphire/type/prebuild/type-node-v108-darwin-arm64-unknown-unknown/type.node'.
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1340:18)
at Module.load (node:internal/modules/cjs/loader:1119:32)...
Question about "runIn" preconditions
Hello! According to the docs regarding setting the channel types a command can run in. In theory setting the command's Should make the command run in both text channels and voice based text channels. However, setting it like this, doesn't allow me to run them to both channel types. What I can do was to only set one channel type in
runIn
to // ...
runIn: [CommandOptionsRunTypeEnum.GuildText, CommandOptionsRunTypeEnum.GuildVoice]
// ...
// ...
runIn: [CommandOptionsRunTypeEnum.GuildText, CommandOptionsRunTypeEnum.GuildVoice]
// ...
runIn
and it'd work for that particular channel type only. How can I make it so that I can allow the command to run in both channel types?...Passing a new parameter to commands
Heyo!
I am converting my bots to Sapphire, and on one of them, I pass the entity manager of my ORM to each command as I call them so I don't create too many (or else it creates a memory leak). So basically, I create an entity manager every time there's an event, instead of every time I need one.
That worked fine before Sapphire, because I was the one calling my commands. But now, I am not anymore! So I thought about a way to do it....
ts-node vs tsc
when i compile with tsc the code works fine, but with ts-code it stops for some reasons
First Argument
const user = await args.pick("member").catch(() => null);
With this code I tried to make the bot get the member from the first argument but looks like it only gets the member if the bot finds it on the second argument, third, etc, how can I fix it?...Error
```js
[ERROR] Encountered error on event listener "CorePreMessageCommandRun" for event "preMessageCommandRun" at path "C:\Users\cmart\Desktop\Discord Bots\Sapphire\node_modules@sapphire\framework\dist\optional-listeners\message-command-listeners\CorePreMessageCommandRun.js" TypeError: result.isErr is not a function
at Object.messageSequential (C:\Users\cmart\Desktop\Discord Bots\Sapphire\node_modules@sapphire\framework\dist\lib\utils\preconditions\conditions\PreconditionConditionAnd.js:10:18)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async CoreListener.run (C:\Users\cmart\Desktop\Discord Bots\Sapphire\node_modules@sapphire\framework\dist\optional-listeners\message-command-listeners\CorePreMessageCommandRun.js:19:25)...
trigger command with regex?
is there a way to use regex patterns to to trigger a command when someone sends a message that matches one? commando-js had a 'patterns' property in the command constructor, I'm looking for something like that. sorry if i missed an obvious answer
Preconditions
Using preconditions, If a user does not meet the requirements to run a command I want the bot delete the message instead of sending a message, how can I do it?
Can I have multiple autocomplete interaction handlers?
When an autocomplete interaction comes through, if one of the autocomplete handlers returns
this.none()
in the parse
method, will it still run the other handlers until it finds one that returns this.some()
?Lot of problems with SapphireJS
Hello, I have some problems
First of all with the i18next plugin integrated into sapphire, I would like to compile my languages ​​folder instead of leaving it forever in the dist
Then with the ModalSubmitInteraction, I cannot retrieve Interaction to pass it to i18next in order to display a translation...