Baylem
Explore posts from serversSIASapphire - Imagine a framework
•Created by Baylem on 7/3/2024 in #sapphire-support
Preconditions Help
The above means AllStaff AND BreakRoom right?
and then this would mean AllStaff OR BreakRoom?
5 replies
SIASapphire - Imagine a framework
•Created by Baylem on 4/17/2024 in #sapphire-support
API Plugin Prefix
Hey all, for some reason my prefix isn't applying on the data paths
This is my env file:
This is the line from the ServerOptions:
This is the user route in the
routes
folder:
So this means that it should be accessible on 127.0.0.1:4000/v1/hello-world
or localhost:4000/v1/hello-world
correct? I'm only getting a response from 127.0.0.1:4000/hello-world
and localhost:4000/hello-world
I've read through the docs and am probably missing something simple, just been overlooking it I guess or I don't understand enough about the implementation, maybe this doesn't matter unless the environment is set up with to use that route6 replies
SIASapphire - Imagine a framework
•Created by Baylem on 4/7/2024 in #sapphire-support
Splitting Subcommand functions to multiple files
I have a command that has quite a few subcommands. I was wondering if there was any way to directly place a function in the
messageRun
chatInputRun
entries so I could split the Subcommands into their own files/classes as the main command file is roughly 2.5k lines at the moment.
I know I could just have each method inside of the class then call the other classes/files inside of it (which is what I'm currently doing), just wanted to see if there was a cleaner way.
Is this possible?
what I'm currently doing:
4 replies
SIASapphire - Imagine a framework
•Created by Baylem on 11/9/2023 in #sapphire-support
Issue with code not running after using args.rest('string') (NOT SAPPHIRE ISSUE)
https://i.imgur.com/UF6eC5d.png
What am I missing here that is producing these results? Is this something weird with TypeScript or am I misunderstand Args. It seems to just stop running and doesn't get to the bottom two console log outputs, or even the one directly below the line of code
4 replies
SIASapphire - Imagine a framework
•Created by Baylem on 11/7/2023 in #sapphire-support
Invoking Command method from other command
Hey all, I’m not really sure if this is a “Sapphire support” type of question more than a TypeScript one (I’m new to TS in general)
But is there any way to invoke a commands messageRun or the designated method from say another command class (something like Java reflection/does sapphire have a command handler to grab the appropriate method?) or is the best way to extract the code to a new file then just call that from both commands?
Basically I have a command which is:
$account link <region> <account name>
But I also have another command which is:
$verify <region> <account name>
or
$verify <account name>
Is there any way for me to just have the verify commands call the: $account link chat input method
Or is the best way to just have like a Verification.ts and have the command logic in there and call that method from every command.
Honestly just trying to minimize ts files if possible
8 replies
SIASapphire - Imagine a framework
•Created by Baylem on 10/16/2023 in #sapphire-support
Sapphire json Configuration
So I arranged my packages like this below:
https://i.imgur.com/crYUZyB.png
and I changed my .sapphirerc.json to:
But it seems sapphire is not picking anything up, what other steps would I be missing?
(side note its 2am so im probably just doing this wrong)
4 replies
SIASapphire - Imagine a framework
•Created by Baylem on 8/28/2023 in #sapphire-support
Broken TypeScript command (from lack of knowledge of TS)
I'm attempting to create a command following the Sapphire wiki, but it seems that I can't get the command to work at all.
Note: I am very new to Typescript, I am not familiar with the syntax or the proper form to do stuff, please be gentle
This is the command I created, the .js version worked, but when i moved it over to TypeScript it just stopped working entirely.
63 replies