aikar / commands

Java Command Dispatch Framework - (Bukkit, Spigot, Paper, Sponge, Bungee, JDA, Velocity supported, generically usable anywhere)
https://acfspigot.emc.gs
MIT License
552 stars 144 forks source link

[JDA] Message content intent #366

Open kyngs opened 2 years ago

kyngs commented 2 years ago

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 commented 2 years ago

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.

NachtRaben commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Might be some useful information here that users have already gathered. https://github.com/DV8FromTheWorld/JDA/pull/2113

chickeneer commented 1 year ago

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 commented 1 year ago

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.