Can sapphire framework handle edits?
It's a similar concept to what discord-akairo used to have back in the days like your command would be executed if a user edited their message to a command trigger
Solution:Jump to solution
I think some other frameworks fully obfuscate the reply layer but Sapphire doesn't because that then makes assumptions about how you would reply. For example message replies cannot be ephemeral, interaction replies can be. So rather than making assumptions and wrappers for all the different layers we just ask users to implement their own logic. There simply will never be a one size fits all.
5 Replies
Yes, install and register @sapphire/plugin-editable-comands and use it's
send
method to send messages.
That said, chat input commands can inherently never be edited so keep that in mind. Like Discord we also implore everyone to leverage the power of chat input commands.Ok thanks a lot another question does it also support hybrid commands so i don't really have to use all the methods seperately and if we can't is there any way i can extend the structure inheretently
Sapphire support hybrid commands yes if that's what you're asking. Just implement both
messageRun
and chatInputRun
and separate the duplicate logic to your own method which you call from both.
very rough example:
Solution
I think some other frameworks fully obfuscate the reply layer but Sapphire doesn't because that then makes assumptions about how you would reply. For example message replies cannot be ephemeral, interaction replies can be. So rather than making assumptions and wrappers for all the different layers we just ask users to implement their own logic. There simply will never be a one size fits all.
Thanks i appreciate for the example ❤️