What am I supposed to trust, the basic slash command registering? Or the Wiki's Commands section?
Stuff under Creating a basic slash command seems to be heavily outdated, it says the type is Command.Registry in some parts, but vscode is never actually auto completing to that. Instead it auto completes to ApplicationCommandRegistery type, and Awaitable stuff as the return of registerApplicationCommands, it started to be totally different approach here, then I saw fetchReply is also outdated, and the new one, which is withResponse is no where similar to be usable in isMessageInstance, is it basically an outdated guide from start to end? So I should only continue with next pages? Commands examples under Commands section also uses ApplicationCommandRegistry rather than stuff under Command namespace
37 Replies
erm... oops? haha.
You can use @sapphire/cli to generate a template
Yeah this seems better, but again, even template differs from examples or how to's in documentation, the very first difference I noticed was use of @ApplyOptions decorators that is no where mentioned under Commands section.
that's intentional because we automatically convert TS samples to ESM and CJS and that would mess with decorators
but whatever goes in ApplyOptions maps 1:1 with command options
you can also check out some of the public repos:
Discord Bots using @sapphire/framework
v5.x
- Gemboard ᴱ ᴰ
- Skyra ᴱ ᴬ ᴰ
- Dragonite ᴱ ᴰ
- Archangel ᴱ ᴰ
- Official Bot Examples ᴱ ᴰ ᴶˢ
- KBot ᴱ ᴬ ᴰ
- Perpetual Mechanical Array ᴰ
- Birthdayy ᴰ
- Sapphire Application Commands Examples ᴱ
Legend for the identifiers
ᴱ: Uses ESM (if not specified then uses CJS)
ᴬ: Advanced bot (if not specified it is a simple bot, or not graded)
ᴰ: Uses Docker in production
ᴶˢ: Written in JavaScript. If not specified then the bot is written in TypeScript.
none of these go into detail how to deal with the deprecation notice and #isMessageInstance
that seems to be a completely separate question. Please create your own thread.
and the new one, which is withResponse is no where similar to be usable in isMessageInstance
oh well
point still stands that I replied to afterglow though
ok.. but im trying to say is that the example bots are not helpful, cause they also have not been updated
gemboard, skyra, dragonite, archangel, and sapphire application commands examples all have been
the others youll have to bugger their creators, not us
ok actually.. dont make sure of this
huh?
and then you run into the issue that the reply is no longer a Message type but a InteractionCallbackResponse type
utility func would that be, instead of using #isMessageInstance
Look at it this way, this is a good learning experience of reading documentation and trial and error. You learn nothing from getting everything spoonfed on a silver platter.
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
well thanks for the learning experience. but the code is from the guide..
took me a whole 2 seconds to find that property because typescript autocompleted it for me though
and ive never used this bit of code before
i didnt even know that was put in between by djs
just did a very quick
variable.
to see what intellisense pops up as options for what is available as properties
anywaybe the change you want to see, make a PR to https://github.com/sapphiredev/website to update the guides
GitHub
GitHub - sapphiredev/website: Documentation for Sapphire Project
Documentation for Sapphire Project. Contribute to sapphiredev/website development by creating an account on GitHub.
Sapphire Framework
Creating a basic slash command | Sapphire
This section covers the absolute minimum for setting up a slash command. We have an entire "Application Commands"
You have to understand that it's not like we get paid to keep everything up to date (as much as we wish we would) and it's extremely tiresome work that none of us (that is to say, the maintainers) really want to constantly do, let alone have time to do. We all have full time jobs and/or studies in IT as developers and generally after a full day of working we just want to relax and do our own things instead of even more coding. We don't have the advantage of youth anymore.
i get that.. but documentation should be up to date, and if it is not, a notice will do. or even just for which version it is. cause that is not very aparent
which is why we recommend people to make pull requests
quite frankly, do you have any idea what it would take to document which discordjs version something is written for on every single page and constantly keep that up to date and accurate? I don't think you realise the scope of what you're asking.
understandable.. will be making one when i think I figured it out... tbh.. i never worked typescript in bigger ecosystems before so its new to me
its not like you need to touch older version-guides but thats just how it has to be done...
We only have 1 version of the guide though. As you can see on the website, there is no version picker. Does Docusaurus support versioning guides? yes. Does that also require a lot of configuration and careful file management? also yes
ok I get that it might be an overhead but i can tell you, as a first time user this is very frustrating... If i would have at least known that the guide is not for my version, I woulnd have lost so much time
I would love it if I had the motivation to do this and so many other things but I just dont. I'm just 1 person and it's a massive project.
yea... i know that from somewhere
to give another example, if you go through the help channel you will notice that a good 95% of the questions are answered by me and me alone. I've been clammoring for years for the other developers to take this channel more serious and also answer questions but nothing has ever come from it.
a project is finished, when you end it.. thats how I see it. never found anyone to help out with mine, help with support or take it over
sadly sapphire is never finished because discord api always changes and therefore discordjs always changes
and yeah if there would be other people supporting it wouldnt be so bad but there arent
occassionally we've had a person do a few contributions but people never stick around
would love to help, but I'm not a good js/ts dev and maintain way too much myself already as well
im confident if there would be a team of at least 2-3 others who are active on the development then we'd all motivate each other and sapphire would move forward much more efficiently. I need only look at the project I work on for work as evidence for that.
I mean that's how sapphire got where it is now, with Kyra, Vladdy and I doing a lot and quickly.
im gald you found someone ^^'
im still a one man show, really.. while its ntoht e most complex projects.. I do have a few of them
im using
const msg = await interaction.fetchReply();
now.. seems more common also with your bots
ah
btw just my 2 cents but I wouldnt add a /ping in your final bot once you're all done 😉 Just add a /info similar to the ones that bots here have. You can add more info in it and it's actually useful for users. Ping was nice with message based commands because you can kinda hide it but really it's primarily a developer facing command and not really useful to end users. Because users already have loads and slash commands on their server / user, adding a fairly useless one to that is just bloat.
im just messing around with commands at the moment, trying to understand stuff atm...
mhm yeah
that's why I said when you're all done
i actually dont recall ever making a ping command on a production bot 😄
nvm... it do be there... yea i dont need it.. cause its not really a good latency test anyways. and my status page handels latency records