#Multiple slash commands with the same name

1 messages · Page 1 of 1 (latest)

outer oyster
#

Hello,

i am migrating from Commands to SlashCommands and I am facing an issue. I used Command overloading to achieve that User and Administrator can set the same thing. For example: User wants to buy a channel, but needs help. Administrator can create the channel for user. Both used the same command, only Admin had to mention User in the command. And the Admin command had a permission check using an attribute.

Is there a way how can i preserve this idea with Admin and NonAdmin version of the same command?

Thanks for help 🙂

vital depot
#

You could perform a perm check in the command but using separate commands is always recommended, because it let's Admins manage permissions however they wish

outer oyster
short helm
vital depot
#

Nope, permissions are handled at base command level

vital depot
outer oyster
vital depot
#

You could have /buy for users and /buy-admin for admins

outer oyster
#

Ok and can i use a Custom precondition to filter which commands should be displayed to a user?

#

For example: Show command /print-two only to a user which has a digit 2 in its Id?

vital depot
#

No, you can only use DefaultPermissions because of a discord restriction, however server administrators can fine tune permissions

#

If your bot can handle oauth2 you could request a scope that let's you manage user and role overwrights to your perms

outer oyster
#

oh, i see. That's a cool idea