Hybrid commands

Is there something like hybrid command which can be used to create prefix and slash commands and also the execution together like discord.py
Solution:
¯\_(ツ)_/¯
Jump to solution
14 Replies
Favna
Favna•2y ago
just add both a chatInputRun and messageRun to the command file
Np 🌸
Np 🌸OP•2y ago
Wanted something like this
Favna
Favna•2y ago
and I told you how we support it omegalul
class MyCommand extends Command {
messageRun(message) {
// parse options
return theActualCommnadLogic(args);
}


chatInputRun(interaction) {
// parse options
return theActualCommnadLogic(args);
}

theActualCommandLogic(args) {
// do actual stuff
}
}

module.exports = { MyCommand }
class MyCommand extends Command {
messageRun(message) {
// parse options
return theActualCommnadLogic(args);
}


chatInputRun(interaction) {
// parse options
return theActualCommnadLogic(args);
}

theActualCommandLogic(args) {
// do actual stuff
}
}

module.exports = { MyCommand }
not sure how that's any harder to make
Krish
Krish•2y ago
messageRun: works for message based prefix chatInputRun: works for slash commands (if you can't figure it out) the migrating guide explains it pretty well
Favna
Favna•2y ago
works for chat input commands* to be more specific. "slash commands" is a user term but not the term Discord officially uses on that note, chat input commands are a subcategory of application commands (which also includes context menu commands)
Krish
Krish•2y ago
but that's how you make people understand what it actually does
Solution
Krish
Krish•2y ago
¯\_(ツ)_/¯
Krish
Krish•2y ago
https://www.sapphirejs.dev/docs/Guide/getting-started/updating-from-v3-to-v4 Here's the migrating guide which explains how to use both ^
Sapphire Framework
Updating from v3 to v4 | Sapphire
Before you start
Np 🌸
Np 🌸OP•2y ago
Bruh I ended up migrating to discordpy instead 😵
Favna
Favna•2y ago
shrug python kids never change
Np 🌸
Np 🌸OP•2y ago
What's wrong with python
Favna
Favna•2y ago
other than that the fact that it uses indents instead of semi-colons, nothing. It's just that people who use python for discord bots always swear by python. You're far from the first who comes in this server, realises Sapphire doesn't work exactly the same as Dpy, and scuddles right back to it.
Krish
Krish•2y ago
lol
ararou!
ararou!•2y ago
so we're dissin languages in support k
Want results from more Discord servers?
Add your server