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

Add support for local and global chats in Discord #4684

Merged
merged 2 commits into from
May 1, 2023

Conversation

brawaru
Copy link
Contributor

@brawaru brawaru commented Dec 12, 2021

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

@triagonal triagonal added module: discord Issues or PRs for the EssentialsDiscord module type: enhancement Features and feature requests. labels Dec 15, 2021
@brawaru brawaru force-pushed the feat/discord-esschat-events branch from afb5859 to 77c5f81 Compare June 1, 2022 03:08
@brawaru brawaru force-pushed the feat/discord-esschat-events branch from 77c5f81 to 448fcfe Compare June 16, 2022 07:27
@brawaru brawaru force-pushed the feat/discord-esschat-events branch from 448fcfe to 1db6cc9 Compare July 6, 2022 19:48
@brawaru brawaru force-pushed the feat/discord-esschat-events branch 2 times, most recently from 9fd7a6c to d265ce3 Compare August 19, 2022 11:35
Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

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

few things

@JRoy JRoy added this to the 2.20.0 milestone Aug 19, 2022
@JRoy JRoy added this to In progress in Discord module via automation Aug 19, 2022
@brawaru brawaru force-pushed the feat/discord-esschat-events branch from d265ce3 to f6c49dd Compare August 20, 2022 12:54
@JRoy JRoy modified the milestones: 2.20.0, 2.21.0 Apr 28, 2023
@JRoy
Copy link
Member

JRoy commented Apr 29, 2023

@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 brawaru force-pushed the feat/discord-esschat-events branch from f6c49dd to 26d8033 Compare April 30, 2023 00:52
@brawaru
Copy link
Contributor Author

brawaru commented Apr 30, 2023

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
Copy link
Member

@JRoy JRoy left a comment

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 😄

@JRoy JRoy enabled auto-merge (squash) May 1, 2023 01:17
@JRoy JRoy merged commit e5b0c4c into EssentialsX:2.x May 1, 2023
1 check passed
Discord module automation moved this from In progress to Done May 1, 2023
@JRoy JRoy modified the milestones: 2.21.0, 2.20.0 May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: discord Issues or PRs for the EssentialsDiscord module type: enhancement Features and feature requests.
Projects
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