Skip to content

Add support for local and global chats in Discord - #4684

Merged
JRoy merged 2 commits into
EssentialsX:2.xfrom
brawaru:feat/discord-esschat-events
May 1, 2023
Merged

Add support for local and global chats in Discord#4684
JRoy merged 2 commits into
EssentialsX:2.xfrom
brawaru:feat/discord-esschat-events

Conversation

@brawaru

@brawarubrawaru commented Dec 12, 2021

Copy link
Copy Markdown
Contributor

This pull request is a draft since it requires #4683 to be merged first.


Information

×

Details

Proposed feature:

This change makes use of added separate events for local and global chats in , making it possible to change the formatting of messages sent from different chat types, as well as disable them altogether (for example, if you don't want to see local chat messages in Discord).

By default Essentials Discord will continue to use Bukkit chat events without any kind of separation, you must explicitly opt in to have new behaviour by changing use-essential-events to true.

Environments tested:

OS: Windows 10 20H2.

Java version:

openjdk version "17" 2021-09-14 LTS
OpenJDK Runtime Environment Zulu17.28+13-CA (build 17+35-LTS)
OpenJDK 64-Bit Server VM Zulu17.28+13-CA (build 17+35-LTS, mixed mode, sharing)
  • Most recent Paper version (1.18.1, git-Paper-71)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Screenshot of the Minecraft chat mirroring to Discord. Brawaru joins the server and says ‘hey’, it gets repeated to Discord as ‘Brawaru: hey’. Brawaru then says ‘now I will enable essentials events’. After enabling them Brawaru says ‘nothing has changed, since local chat is not enabled’, continued ‘I will now enable local chat’. Those messages were repeated to Discord as before. Brawaru then says ‘hello from local chat’, an ‘L’ appears at the beginning of his message, the message gets repeated in Discord as ‘[Local] Brawaru: hello from local chat’. Brawaru then uses question syntax and asks, ‘I am rather looking forward to this analysis, aren't you?’, it gives the message prefix ‘Question’, the same prefix appears in repeated Discord message. Brawaru then shouts ‘Agent Coomer, report to Topside Tactical Operations Center.’, it has ‘Shout’ prefix, the same prefix appears in Discord. In the end Brawaru says ‘now I set message-types.local to “none”, local chat is no longer visible in discord’; which is true and the message doesn't appear in Discord.

Fixed#4989

@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch from 3165a7e to 1741621CompareDecember 12, 2021 22:59
@triagonaltriagonal added module: discord Issues or PRs for the EssentialsDiscord module type: enhancement Features and feature requests. labels Dec 15, 2021
@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch from 1741621 to afb5859CompareFebruary 14, 2022 08:36
@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch from afb5859 to 77c5f81CompareJune 1, 2022 03:08
@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch from 77c5f81 to 448fcfeCompareJune 16, 2022 07:27
@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch from 448fcfe to 1db6cc9CompareJuly 6, 2022 19:48
@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch 2 times, most recently from 9fd7a6c to d265ce3CompareAugust 19, 2022 11:35

@JRoyJRoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few things

Comment threadEssentialsDiscord/src/main/resources/config.yml
Comment threadEssentialsDiscord/src/main/resources/config.yml Outdated
@JRoyJRoy added this to the 2.20.0 milestone Aug 19, 2022
@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch from d265ce3 to f6c49ddCompareAugust 20, 2022 12:54
@JRoyJRoy modified the milestones: 2.20.0, 2.21.0Apr 28, 2023
@JRoy

JRoy commented Apr 29, 2023

Copy link
Copy Markdown
Member

@brawaru could you update this to the latest 2.x so we can get this merged :)

This change makes use of added separate events for local and global
chats, making it possible to change formatting of messages sent from
different chat types, as well as disable them altogether (for example,
if you don't want to see local chat messages in Discord).
By default Essentials Discord will continue to use Bukkit chat events
without any kind of separation, you must explicitly opt in to have new
behaviour by changing use-essential-events to true.
@brawaru
brawaruforce-pushed the feat/discord-esschat-events branch from f6c49dd to 26d8033CompareApril 30, 2023 00:52
@brawaru

Copy link
Copy Markdown
ContributorAuthor

Rebased, but haven't tested anything yet. Will try to when I have time.

@JRoy
JRoy marked this pull request as ready for review May 1, 2023 01:04

@JRoyJRoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know why i requested these be enabled by default, they should be disabled 😄

Comment threadEssentialsDiscord/src/main/resources/config.yml Outdated
@JRoy
JRoy enabled auto-merge (squash) May 1, 2023 01:17
JRoy
JRoy approved these changes May 1, 2023
@JRoy
JRoy merged commit e5b0c4c into EssentialsX:2.xMay 1, 2023
@JRoyJRoy modified the milestones: 2.21.0, 2.20.0May 1, 2023
rewsdjad1 pushed a commit to rewsdjad1/EssentialsXPlus that referenced this pull request Aug 13, 2026
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: discordIssues or PRs for the EssentialsDiscord moduletype: enhancementFeatures and feature requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EssentialsDiscord: local messages treated as global and relayed when all players are in local message range

3 participants

@brawaru@JRoy@triagonal