Skip to content

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

Merged
mdcfe merged 13 commits into
2.xfrom
discord-addon/account-linking
Dec 26, 2022
Merged

[EssentialsXDiscord Addon] Discord<->MC Account Linker#4155
mdcfe merged 13 commits into
2.xfrom
discord-addon/account-linking

Conversation

@JRoy

@JRoyJRoy commented May 16, 2021

Copy link
Copy Markdown
Member

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

@JRoyJRoy added the type: enhancement Features and feature requests. label May 16, 2021
@JRoyJRoy added this to the 2.19.0 milestone 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
Copy Markdown
Contributor

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?

@JRoyJRoy 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
Copy Markdown
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
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentialsDiscordLink/src/main/resources/config.yml Outdated
Comment threadEssentialsDiscordLink/src/main/resources/config.yml Outdated
Comment threadEssentialsDiscordLink/src/main/resources/plugin.yml Outdated
Comment threadEssentialsDiscordLink/src/main/resources/plugin.yml Outdated
Comment threadEssentialsDiscordLink/src/main/resources/plugin.yml Outdated
Base automatically changed from module/discord to 2.xJuly 1, 2021 13:43
@JRoy
JRoy changed the base branch from 2.x to module/discordJuly 1, 2021 22:22
@Andre601

Copy link
Copy Markdown
Contributor

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
JRoyforce-pushed the discord-addon/account-linking branch from ea34da4 to f60355fCompareJuly 2, 2021 01:17
@JRoy
JRoy changed the base branch from module/discord to 2.xJuly 2, 2021 01:18
@JRoy
JRoy requested a review from mdcfeJuly 2, 2021 01:19
@pop4959

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

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

JRoy commented Jul 3, 2021

Copy link
Copy Markdown
MemberAuthor

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.

@mdcfemdcfe modified the milestones: 2.19.0, 2.19.1Aug 19, 2021
@JRoy

JRoy commented Sep 2, 2021

Copy link
Copy Markdown
MemberAuthor

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
@JRoyJRoy modified the milestones: 2.19.1, 2.20.0Oct 13, 2021
@JRoyJRoy changed the title [EssentialsXDiscord Addon] Discord<->MC Account Linker[EssentialsXDiscord Addon] Discord<->MC Account Linker Account LinkeOct 13, 2021
@JRoyJRoy changed the title [EssentialsXDiscord Addon] Discord<->MC Account Linker Account LinkeAccount Link ModuleOct 13, 2021
@JRoyJRoy changed the title Account Link ModuleAccount Link Module Oct 13, 2021
@JRoyJRoy changed the title Account Link Module Linking System[EssentialsXDiscord Addon] Discord<->MC Account LinkerOct 13, 2021
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentials/src/main/resources/messages.properties Outdated
Comment threadEssentialsDiscordLink/build.gradle Outdated

@mdcfemdcfe 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.

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

Comment threadEssentials/src/main/java/com/earth2me/essentials/IUser.java
Comment threadEssentialsDiscordLink/README.md
@untuned

Copy link
Copy Markdown
Contributor

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

JRoy commented Nov 27, 2022

Copy link
Copy Markdown
MemberAuthor

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
JRoyforce-pushed the discord-addon/account-linking branch from 3654032 to cb59dd6CompareDecember 25, 2022 21:28
@mdcfe
mdcfe enabled auto-merge (rebase) December 26, 2022 01:22
@mdcfe
mdcfe merged commit 0936fe8 into 2.xDec 26, 2022
@Cem03

Copy link
Copy Markdown

[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 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.

7 participants

@JRoy@Andre601@pop4959@untuned@Cem03@mdcfe@Octol1ttle