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

[EssentialsXDiscord Addon] Discord<->MC Account Linker #4155

Merged
merged 13 commits into from
Dec 26, 2022

Conversation

JRoy
Copy link
Member

@JRoy JRoy commented May 16, 2021

A separate plugin/addon on top of EssentialsXDiscord to add linking functionality between discord and minecraft.

Tracking Ideas from https://github.com/orgs/EssentialsX/projects/1#card-57639460

@JRoy JRoy added the type: enhancement Features and feature requests. label May 16, 2021
@JRoy JRoy added this to the 2.19.0 milestone May 16, 2021
@JRoy JRoy added this to In progress in Discord module via automation May 16, 2021
@JRoy JRoy marked this pull request as ready for review May 20, 2021 00:13
@JRoy JRoy marked this pull request as draft May 20, 2021 00:13
@Andre601
Copy link
Contributor

Andre601 commented Jun 5, 2021

One Idea:

  • Make Users replying to other users in Discord show as a /msg output if both (or maybe just the recipient?) have their account linked.

Example: Me replying to you would result in Andre_601 -> me: Hello! be posted in the MC chat while you're online.

Issues I see here now is, how or if there should be an indicator in the message syntax to show that the message was from Discord.
Also how would the replies be handled from a MC to Discord like way?

@JRoy JRoy added the module: discord Issues or PRs for the EssentialsDiscord module label Jun 17, 2021
@JRoy JRoy marked this pull request as ready for review June 26, 2021 22:35
@JRoy JRoy marked this pull request as draft June 26, 2021 22:35
@Andre601
Copy link
Contributor

To adress my previous comment do I have an idea for a possible MC -> Discord msg option. Just have a discord: prefix for the player names when using /msg to indicate Discord users.
Maybe to not fill the suggestion list with hundreds of names, only suggest names you received a message from recently?

Like here would be the full Idea again with the new suggestion added:

  1. I use /msg on Discord to send a message to you in Minecraft
  2. You receive the Essentials Message: Andre_601#0601 -> Me: Hey there
  3. You now type /msg and get discord:Andre_601#0601 suggested as a selectable player
    • The /r command would act as a shortcut here. Maybe even with an option to make the bot actually reply to the original command? Would be difficult if the response message is ephemeral tho.
  4. You send me a message back: JRoy -> Me: Hi

I hope this idea still makes sense to you

mdcfe
mdcfe previously requested changes Jul 1, 2021
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
EssentialsDiscordLink/src/main/resources/config.yml Outdated Show resolved Hide resolved
EssentialsDiscordLink/src/main/resources/config.yml Outdated Show resolved Hide resolved
EssentialsDiscordLink/src/main/resources/plugin.yml Outdated Show resolved Hide resolved
EssentialsDiscordLink/src/main/resources/plugin.yml Outdated Show resolved Hide resolved
EssentialsDiscordLink/src/main/resources/plugin.yml Outdated Show resolved Hide resolved
Base automatically changed from module/discord to 2.x July 1, 2021 13:43
@JRoy JRoy changed the base branch from 2.x to module/discord July 1, 2021 22:22
@Andre601
Copy link
Contributor

Andre601 commented Jul 2, 2021

Is that notif spam (*cough* @JRoy posting trollface *cough*) really necessary?
I don't mind Notifications that much, but I DO mind having 15(!!!) E-Mails from GitHub within 5-10 minutes.

I know I know, you do reviews and stuff, but did you consider people watching this PR for possible progress and don't want to have spam?

@JRoy JRoy force-pushed the discord-addon/account-linking branch from ea34da4 to f60355f Compare July 2, 2021 01:17
@JRoy JRoy changed the base branch from module/discord to 2.x July 2, 2021 01:18
@JRoy JRoy requested a review from mdcfe July 2, 2021 01:19
@pop4959
Copy link
Member

pop4959 commented Jul 3, 2021

I'm sure this has been discussed... but since I've apparently been living under a rock, why is EssentialsDiscordLink a completely separate plugin from EssentialsDiscord? It seems to me like it would make much more sense to merge the two together.

@Andre601
Copy link
Contributor

Andre601 commented Jul 3, 2021

I'm sure this has been discussed... but since I've apparently been living under a rock, why is EssentialsDiscordLink a completely separate plugin from EssentialsDiscord? It seems to me like it would make much more sense to merge the two together.

I agree, but on the other hand would I assume that it could be considered bloat having this feature implemented in the base Module.
Some people may only want to have basic chat and some command stuff that doesn't require things like account linking and perm check.

@pop4959
Copy link
Member

pop4959 commented Jul 3, 2021

Yeah but EssentialsDiscord has already become more than just a simple chat bridge. Arguably if this is going to be its own module, the stuff for console relay, etc, should have as well. I don't really see the distinction here. Making people download yet another addon (for what is already an addon) makes little sense to me, and seems like something people are just gonna complain about.

In terms of bloat, there's barely anything really added to the configuration by this. There's like 3 configuration options, which could just be its own little section in the main addon. Everything could be disabled by default, as with the console relay.

@JRoy
Copy link
Member Author

JRoy commented Jul 3, 2021

In terms of bloat, there's barely anything really added to the configuration by this. There's like 3 configuration options, which could just be its own little section in the main addon. Everything could be disabled by default, as with the console relay.

Role sync is going to be a part of this as well, which I feel is fairly big. I'd like to keep these code bases separate to make it easier to maintain and to force myself to keep the addon API quality high.

@mdcfe mdcfe modified the milestones: 2.19.0, 2.19.1 Aug 19, 2021
@JRoy
Copy link
Member Author

JRoy commented Sep 2, 2021

The EssentialsX Discord Link module is now feature complete and ready for review!

cc @mdcfe

@JRoy JRoy marked this pull request as ready for review September 2, 2021 21:06
@JRoy JRoy modified the milestones: 2.19.1, 2.20.0 Oct 13, 2021
@JRoy JRoy changed the title [EssentialsXDiscord Addon] Discord<->MC Account Linker [EssentialsXDiscord Addon] Discord<->MC Account Linker Account Linke Oct 13, 2021
@JRoy JRoy changed the title [EssentialsXDiscord Addon] Discord<->MC Account Linker Account Linke Account Link Module Oct 13, 2021
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
Essentials/src/main/resources/messages.properties Outdated Show resolved Hide resolved
EssentialsDiscordLink/build.gradle Outdated Show resolved Hide resolved
Copy link
Member

@mdcfe mdcfe left a comment

Choose a reason for hiding this comment

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

Preliminary skin review, more in-depth review will come later

@untuned
Copy link
Contributor

untuned commented Nov 26, 2022

If a member who's linked leaves the Discord server, an Unknown Member error appears upon role sync.

[12:49:04 ERROR]: [net.essentialsx.dep.net.dv8tion.jda.api.requests.RestAction] RestAction queue returned failure: [ErrorResponseException] 10007: Unknown Member
net.essentialsx.dep.net.dv8tion.jda.api.exceptions.ContextException: null
        at net.essentialsx.dep.net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54) ~[EssentialsXDiscord-2.20.0-dev+10-7d61305.jar:?]
        at net.essentialsx.dep.net.dv8tion.jda.api.requests.Request.<init>(Request.java:71) ~[EssentialsXDiscord-2.20.0-dev+10-7d61305.jar:?]
        at net.essentialsx.dep.net.dv8tion.jda.internal.requests.RestActionImpl.queue(RestActionImpl.java:197) ~[EssentialsXDiscord-2.20.0-dev+10-7d61305.jar:?]
        at net.essentialsx.dep.net.dv8tion.jda.internal.requests.DeferredRestAction.queue(DeferredRestAction.java:134) ~[EssentialsXDiscord-2.20.0-dev+10-7d61305.jar:?]
        at net.essentialsx.dep.net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:573) ~[EssentialsXDiscord-2.20.0-dev+10-7d61305.jar:?]
        at net.essentialsx.discord.JDADiscordService.getMemberById(JDADiscordService.java:476) ~[EssentialsXDiscord-2.20.0-dev+10-7d61305.jar:?]
        at net.essentialsx.discordlink.rolesync.RoleSyncManager.sync(RoleSyncManager.java:63) ~[EssentialsXDiscordLink-2.20.0-dev+10-7d61305.jar:?]
        at net.essentialsx.discordlink.rolesync.RoleSyncManager.lambda$new$0(RoleSyncManager.java:45) ~[EssentialsXDiscordLink-2.20.0-dev+10-7d61305.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.2.jar:git-Purpur-1848]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.19.2.jar:git-Purpur-1848]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.19.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

@JRoy
Copy link
Member Author

JRoy commented Nov 27, 2022

If a member who's linked leaves the Discord server, an Unknown Member error appears upon role sync.

Thanks for the catch, fixed in the latest build!

mdcfe
mdcfe previously approved these changes Dec 25, 2022
mdcfe
mdcfe previously approved these changes Dec 25, 2022
@JRoy JRoy force-pushed the discord-addon/account-linking branch from 3654032 to cb59dd6 Compare December 25, 2022 21:28
@mdcfe mdcfe enabled auto-merge (rebase) December 26, 2022 01:22
@mdcfe mdcfe merged commit 0936fe8 into 2.x Dec 26, 2022
Discord module automation moved this from In progress to Done Dec 26, 2022
@CemBe1
Copy link

CemBe1 commented Dec 26, 2022

[15:11:52 WARN]: [net.essentialsx.discordlink.EssentialsDiscordLink] Versiyon uyuşmazlığı! Lütfen tüm Essentials jarlarını aynı sürüme güncelleyin.
[15:11:52 ERROR]: Error occurred while enabling EssentialsDiscordLink v2.20.0-dev+35-0936fe8 (Is it up to date?)
java.lang.NoSuchMethodError: 'java.util.Map com.earth2me.essentials.config.EssentialsConfiguration.getStringMap(java.lang.String)'
at net.essentialsx.discordlink.DiscordLinkSettings._getRoleSyncGroups(DiscordLinkSettings.java:60) ~[EssentialsXDiscordLink-2.20.0-dev+35-0936fe8.jar:?]
at net.essentialsx.discordlink.DiscordLinkSettings.reloadConfig(DiscordLinkSettings.java:91) ~[EssentialsXDiscordLink-2.20.0-dev+35-0936fe8.jar:?]
at net.essentialsx.discordlink.DiscordLinkSettings.(DiscordLinkSettings.java:20) ~[EssentialsXDiscordLink-2.20.0-dev+35-0936fe8.jar:?]
at net.essentialsx.discordlink.EssentialsDiscordLink.onEnable(EssentialsDiscordLink.java:52) ~[EssentialsXDiscordLink-2.20.0-dev+35-0936fe8.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:371) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:544) ~[pufferfish-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:578) ~[pufferfish-1.19.3.jar:git-Pufferfish-52]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:492) ~[pufferfish-1.19.3.jar:git-Pufferfish-52]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:637) ~[pufferfish-1.19.3.jar:git-Pufferfish-52]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:436) ~[pufferfish-1.19.3.jar:git-Pufferfish-52]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:303) ~[pufferfish-1.19.3.jar:git-Pufferfish-52]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1103) ~[pufferfish-1.19.3.jar:git-Pufferfish-52]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[pufferfish-1.19.3.jar:git-Pufferfish-52]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
[15:11:52 INFO]: [net.essentialsx.discordlink.EssentialsDiscordLink] Disabling EssentialsDiscordLink v2.20.0-dev+35-0936fe8

Pufferfish 1.19.3 Not working

@JRoy JRoy deleted the discord-addon/account-linking branch December 26, 2022 15:37
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.

None yet

7 participants