Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

Allow the use of non-standard Discord Text Channels

Open Radiant-Xyz opened this issue 1 year ago • 2 comments

Feature description

As reported in #5923 it is currently not possible to use Discord threads (or forum posts) for chat bridging, logging and command functionality. My investigation shows this might be due to the explicit use of TextChannel instead of GuildMessageChannel. If I provide a channel ID for the Discord plugin to use, I would expect for the plugin to work no matter which type of text channel it is, as they all provide the same capabilities as far as I am aware.

How the feature is useful

Discord servers and their structure can vary greatly due to various reasons. Changing the plugin to accept threads and forum posts as text channels for command use, chat bridging and logging would allow more flexibility. It would also cause less confusion during setup for users unfamiliar with the difference between a regular text channel and a thread or post since this is not pointed out clearly in the error messages.

Radiant-Xyz avatar Dec 13 '24 06:12 Radiant-Xyz

As mentioned above, I have already looked into this, but I am not a Java developer nor do I currently have the necessary environment set up to work on this. I've consulted the javadoc of dv8tion's JDA and found GuildMessageChannel with the following description:

Represents all message channels present in guilds. This includes channels that are not included in StandardGuildMessageChannel, such as ThreadChannel.

I had hoped this might be useful to implement this feature request.

Radiant-Xyz avatar Dec 13 '24 06:12 Radiant-Xyz

I've looked into this a bit more and had issues setting up my IDE to recognize all symbols. I still gave it a try to make the proposed adjustments myself, but eventually noticed that the changes I made broke the code related to webhooks.

If I read more into the JDA docs I might find a way to resolve this. In Discord all channels do have webhooks, even forums. Discord bots like Tupperbox which rely on webhooks to send messages work in both threads and forum posts as well, even if their webhook is created for the parent channel only as neither threads or posts have webhooks of their own. Therefore I'm certain there must be a way to get this working.

Radiant-Xyz avatar Dec 27 '24 15:12 Radiant-Xyz