Is there a better way to handle both message and slash commands?
Docs say that you have to override
messageRun
method to handle message commands and override chatInputRun
for slash commands.
This leads to unnecessary code duplication, since logic would be mostly the same.
discord.py
or serenity
expose something like hybrid commands , so you can write a single handler for any interaction, is there an equivalent for Sapphire?Solution:Jump to solution
just extract most logic to a separate function and call it from both, i.e. the ping commands from sapphiredev/examples repo
1 Reply
Solution
just extract most logic to a separate function and call it from both, i.e. the ping commands from sapphiredev/examples repo