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

[JDA] Message content intent #366

Open
kyngs opened this issue Apr 28, 2022 · 7 comments
Open

[JDA] Message content intent #366

kyngs opened this issue Apr 28, 2022 · 7 comments
Labels
jda Related to the ACF JDA Implementation

Comments

@kyngs
Copy link
Contributor

kyngs commented Apr 28, 2022

As of first September 2022, Discord will require bots to have a special (privileged) intent to read messages, if they are on more than 100 guilds.

Discord's devs have clearly stated, that this intent will not be granted to you if you want to use it for commands (!command something).

This makes the current JDA implementation pretty much unusable.

Solutions

There are two solutions I can think of:

  1. Leave it like it is and essentially make it available only for private bots.
  2. Redo the JDA implementation with complete slash command support.

In my opinion, the first solution would be unfortunate. However, I am not sure whether the second solution is even possible.

If you agree, I would do some research and if possible, choose the second solution.
This will break all backward compatibility for applications written for the current JDA implementation.

EDIT: The second option seems promising, I'm going to (attempt) to develop it in my fork. For now as another module. If anyone has any ideas what to add etc. please write them in this issue.

@kyngs
Copy link
Contributor Author

kyngs commented Apr 30, 2022

I've found a few (unfortunate) limitations, I will attempt to keep this list up to date. There might be a workaround for some of these, but I doubt it.

  • After you register all of your commands, you must call propagate() method on the manager. This is because we must (not really, but should) update commands at once.
  • You can only chain subcommands twice. For example: /command sub1 sub2 args is possible, but /command sub1 sub2 sub3 (...) args is not. This will throw an exception when registering
  • I can't really explain it, so I will show it as an example. This is not allowed: Having /command test nom and /command test at the same time. This will also throw an exception when registering
  • You cannot have a default command and subcommands at once.

@NachtRaben
Copy link

Currently have slash command support with my project over at https://github.com/NachtRaben/ArmaCore with a propagation method. Though realistically I'm not very pleased with the implementation as I was learning ACF at the time of writing it, in theory it's not too hard to add it.

Another thing to be mindful of is the new Slash Permissions V2 discord is rolling out at https://discord.com/blog/slash-commands-permissions-discord-apps-bots which might require finer control with annotations and such to implement more seamlessly with user/role/etc based permissions being added to discord.

@kyngs
Copy link
Contributor Author

kyngs commented May 26, 2022

Currently have slash command support with my project over at https://github.com/NachtRaben/ArmaCore with a propagation method. Though realistically I'm not very pleased with the implementation as I was learning ACF at the time of writing it, in theory it's not too hard to add it.

Another thing to be mindful of is the new Slash Permissions V2 discord is rolling out at https://discord.com/blog/slash-commands-permissions-discord-apps-bots which might require finer control with annotations and such to implement more seamlessly with user/role/etc based permissions being added to discord.

Thanks, I will definitely take a look on it. My implementation is also pretty dirty.

@kyngs
Copy link
Contributor Author

kyngs commented Jun 7, 2022

Currently have slash command support with my project over at https://github.com/NachtRaben/ArmaCore with a propagation method. Though realistically I'm not very pleased with the implementation as I was learning ACF at the time of writing it, in theory it's not too hard to add it.

Another thing to be mindful of is the new Slash Permissions V2 discord is rolling out at https://discord.com/blog/slash-commands-permissions-discord-apps-bots which might require finer control with annotations and such to implement more seamlessly with user/role/etc based permissions being added to discord.

So I finally found time for this. According to discord, bot developers cannot really control it yet:
image

So, perhaps, I should implement the current system and wait before the new one gets made public?

@NachtRaben
Copy link

Might be some useful information here that users have already gathered.
discord-jda/JDA#2113

@chickeneer chickeneer added the jda Related to the ACF JDA Implementation label Jun 30, 2022
@chickeneer chickeneer mentioned this issue Sep 17, 2022
@chickeneer
Copy link
Collaborator

I think, the way forward will be to have two modules. A jda module that runs through reading chat (legacy old way).
And another one that registers commands through the slash-command method.

The overall usage would be that the same project could have both versions going through separate command managers.
I think this is a reasonable way to approach this, if you think of a reason it should be handled differently - holler out. :)

@kyngs
Copy link
Contributor Author

kyngs commented Sep 19, 2022

I think, the way forward will be to have two modules. A jda module that runs through reading chat (legacy old way). And another one that registers commands through the slash-command method.

The overall usage would be that the same project could have both versions going through separate command managers. I think this is a reasonable way to approach this, if you think of a reason it should be handled differently - holler out. :)

Makes sense, in my fork I still kept the old module, so it should be safe to use.
However, it will require migration to the new JDA version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jda Related to the ACF JDA Implementation
Projects
None yet
Development

No branches or pull requests

3 participants