Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

[EssentialsXDiscord Addon] Discord<->MC Account Linker

Open JRoy opened this issue 4 years ago • 8 comments

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 avatar May 16 '21 02:05 JRoy

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?

Andre601 avatar Jun 05 '21 14:06 Andre601

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

Andre601 avatar Jun 26 '21 23:06 Andre601

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?

Andre601 avatar Jul 02 '21 00:07 Andre601

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.

pop4959 avatar Jul 03 '21 20:07 pop4959

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.

Andre601 avatar Jul 03 '21 21:07 Andre601

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.

pop4959 avatar Jul 03 '21 21:07 pop4959

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.

JRoy avatar Jul 03 '21 22:07 JRoy

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

cc @mdcfe

JRoy avatar Sep 02 '21 21:09 JRoy

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) ~[?:?]

untuned avatar Nov 26 '22 17:11 untuned

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!

JRoy avatar Nov 27 '22 02:11 JRoy

[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

CemBe1 avatar Dec 26 '22 15:12 CemBe1