-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add User Apps #266
base: current
Are you sure you want to change the base?
Add User Apps #266
Conversation
I would recommend adding an |
Also probably the docs should be updated with the new I can also confirm, that this pr works as expected, when using the current branch of serenity (as is expected). |
Hey, @fgardt do you plan on fixing the CI failures? |
I'll look into it yeah |
b238074
to
3809973
Compare
hello, i've been testing this pr more in depth and subcommands work weirdly:
lets say you have a parent command: /bot and you want to make a "reload" command for the bot owner which reloads the bot #[poise::command(
slash_command,
subcommands("reload"),
install_context = "Guild|User",
// hmm... only 1 command needs to be different; so lets do a non-restrictive selection
interaction_context = "Guild|BotDm|PrivateChannel"
)]
pub async fn bot(_: Ctx<'_>) -> Result<(), CommandError> {}
#[poise::command(
slash_command,
owners_only,
// great! now we can make this a botdm command to prevent confusion?
install_context = "User",
interaction_context = "BotDm"
)]
pub async fn reload(ctx: Ctx<'_>) -> Result<(), CommandError> {
// ... reload logic
} sadly, the subcommand has no control over its interaction_context or its install_context, which means the command will show up in guilds and in group dms, which is not the intended behavior |
Subcommands inherit context and permissions from the parent, this is a limitation of discord itself. At most extra documentation (if there isn't any of inheriting context) can be added, but its already mentioned for permissions in our docs. |
Any idea when this will be merged/released? I'd like to see this functionality become available. |
You are welcome to use this as your base for the mean time but it would be nice to see the API in serenity be updated first before this rolls out. It'll happen when it does and there is no ETA for this feature. |
Any update on this? |
Considering this isn't merged or hasn't had a single commit since your question answers itself, no, there is no update on this. |
What is missing from this pr? |
User Apps should reasonably be stabilized on serenity first as the upstream discord API is stable now. |
this is the implementation for user apps that I've been using like this since 3 days after user apps got announced / released to beta.
I like the flexibility that having
install_context
andinteraction_context
being separate properties brings but there were concerns regarding usability / it being too complex.example:
note: this added the
unstable_discord_api
feature to the serenity dependency, that should probably be removed again(?) I have not found a nice way to feature guard this without having to chain the feature flag in everywhere and some other issues.