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:
just extract most logic to a separate function and call it from both, i.e. the ping commands from sapphiredev/examples repo
Jump to solution
1 Reply
Solution
Favna
Favna7d ago
just extract most logic to a separate function and call it from both, i.e. the ping commands from sapphiredev/examples repo

Did you find this page helpful?