Skip to content
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

Global commands self-delete after creation #49

Open
artkonr opened this issue Dec 20, 2024 · 0 comments
Open

Global commands self-delete after creation #49

artkonr opened this issue Dec 20, 2024 · 0 comments

Comments

@artkonr
Copy link

artkonr commented Dec 20, 2024

Greetings folks,

I have encountered an issue with global discord commands. Given:

  • command declared as .json and put into META-INF/commands
  • the following properties are enabled:
    • quarkus.discord4j.global-commands.delete-missing
    • quarkus.discord4j.global-commands.overwrite-on-start.

While bootstrapping, the extension respects overwrite-on-start and creates the command. With a breakpoint in io.quarkiverse.discord4j.commands.runtime.Discord4jCommandsRegistrar#register on line 63, I was able to ensure that the command gets in fact created.

However, right afterwards, the delete-missing logic kicks in, fetches a list of commands from Discord, fails to find the newly created command and emits deletion request. Look for log line at DEBUG:

2024-12-20 21:41:51,537 DEBUG [io.qua.dis.com.run.Discord4jCommandsRegistrar] (executor-thread-1) Deleted global command testcommand as it does not have a matching JSON file in META-INF/commands

I'd bet that this is because the Discord API is eventually-consistent, which is stated in the API docs. Here's a small reproducer for you: https://github.com/artkonr/discord-command-err-reproducer. I didn't verify the behaviour for guild commands, though.

On a side note, I was also able to observe that global commands do not require an hour to propagate, contrary to what is stated in the documentation. Would be great if you could also fix that too. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant