58 Replies
word 👍
I HAVE THIS COMMAND
i made
thsi
but it doesn't detect the command
it doesn't yap @Lioness100 look
no response
no errors on command
line
Our experience in Klasa, and according to many Akairo users is that built-in help commands suck, and everyone customises them.
Furthermore, having built-in commands force you to add extra logic in your code (specifically everywhere that reads custom properties from commands), so if you rely on a property to exist, because it does in your commands, it'll break easily with built-in ones unless you overwrite them.
A help command is even worse, they give special constraints that shouldn't exist and can be implemented as you desire.
There's also the people who want to only show specific commands, a list of all commands in one embed, paginated commands, paginated lists of commands (based on categories), and all of that can be in either plain text, inside codeblocks (and from there, many syntaxes and formats), or embeds.
And to take things further, there are people who simply want to show all commands, and people who show only the commands they can use.
And so far we have only covered message based commands. Chat input commands are a whole different beast, because they have native descriptions and if you do have a /help for more details that could use autocomplete to fill out the command name.
If you take all the different ways to format commands, you end up with hundreds or thousands of different possibilities.
It is not possible for us to deliver a help command that complies to all those possibilities.
Therefore, everyone will eventually replace the built-in one with their own, so why take the effort?
yo wrong one sorry
When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stacktraces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards.
❯ For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines. ❯ For an excellent video that shows how not to ask technical questions is this, watch this YouTube video by LiveOverflow. ❯ Asking technical questions (Clarkson) ❯ How to ask questions the smart way (Raymond)
also wrong one ugh
im making a prefix command
this is my main.ts
/commands/info/help.ts
If your prefix is , then you should be trying ,help, not $help?
yea
i tried that
i changed prefix aftert
Just fyi this isn't necessary
That's only for preconditions
what r preconditions
i used gpt4
to generate all this code
Oh you forgot the MessageContent intent
ohhh
word?
does it autodetect my handler
or do i needa write a handler
Also add
loadMessageCommandListeners: true
to your client optionsor do it detects my commands
It will detect your commands
I'd recommend just checking out the guide https://www.sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire, but to make the changes I just listed, your main.ts would look like:
Please read our user guide at https://www.sapphirejs.dev/
Sapphire Framework
Home | Sapphire
Sapphire is a next-gen Discord bot framework for developers of all skill levels to make the best JavaScript/TypeScript based bots possible.
can i customize this logger yall gave me?
i did this
didn't work
What's your
main
field in the package.json?why's that needed
my package.json
I recommend you read the documentation
Just the first few pages at least
Hai mom I'm in Lioness' screenshots
funne
I know right, I'm a comedic genius.
last question
why is my typescript being weird
it says
iconurl has to be a string
but i tried putting message.author.avatarURL
it didn't work
i tried
message.author.displayAvatarURL
message.author.avatarURL
and that ternary operator too
I think avatarURL is nullable. I'd use displayAvatarURL, but make sure you're invoking it because it's a function not a property
That ternary operator is useless because
message.author
will always be there. You might've meant message.author.avatarURL ?? '...'
, which will also work
Because it will default to the string if the user doesn't have an avatarthanks
👍
can i customise this logger
Yes, the client options have a
logger
field. You can either set the logger level or add your own logger instance (it just needs to implement ILogger) or use @sapphire/plugin-logger for a pretty onewhy did you edit that 8 times
for fun
i thought you wrote a whole essay
haha
that's amazing.
hey, a design related question where would you put your database files in a bot i have a /src folder which everything is inside that.
do make a folder called db?
or what?
What are the database files?
Like, the actual data? Or schemas/similar?
schema's
schemas
what database are you using
connection file
mongo
I might be off mark but iirc the standard is putting it in a
models/
foldermodels?
isn't that a schema?
ho no
buddy
yup
models
my bad
also wanted to plug https://typegoose.github.io/ in case you're interested
although if this is all you're storing then dont fix what isn't
im just making myself an assistant for lastfm
tbh
Prisma tho
nah cuh
my thought exactly
where can i find the name of all evens
events?
hey @Favna is there a way to get all of the commands?
https://discord.com/channels/737141877803057244/737142209639350343/1151595641307414579
Also please create new threads for new questions so we can properly use @Answer Overflow
Closing this to prevent further derailment