Sign in to follow this  
whisper2shade

[RELEASED] Discord Relay

Recommended Posts

11 hours ago, Sindusk said:

Any other ideas that might be requested.

Maybe server shut down in x minutes messages would be cool.

And in this way, if its possible and the relay can check if the server is online again, to send a message to discord like "server (name) is up and running"

 

Eject

 

add: disbanded deeds message =)

Edited by Eject

Share this post


Link to post
Share on other sites
12 hours ago, Sindusk said:

Here's a new release, but it's moderately different from how the original mod handles things:

  • Only applicable to GL-Kingdom chats. Uses abbreviated kingdom names instead of full ones (#gl-hots for example. Identical to how the name is displayed in-game but lowercased).
  • Prefixes messages from Discord -> ingame with [D] to signify they came from Discord, instead of using a custom name.
  • Prefixes all messages in Discord with the server-side timestamp of when the message was broadcast.
  • Uses member nicknames instead of usernames from Discord. This means if I'm SomeGuy#7799 as my Discord login but my screen name for my server discord is Sindusk, the relay will now use the Sindusk name instead of "SomeGuy"
  • Can now be utilized as a library from other mod authors to link messages into relay. For mod authors interested:
    • Add the line "depends.import=DiscordRelay" to your properties file. Keep in mind this will create a hard dependency on DiscordRelay, meaning if DiscordRelay is not installed on the server, your mod will not work.
    • From your mod, call the method "sendToDiscord(String channel, String message)" to send messages to channels of your choice.

https://github.com/Sindusk/DiscordRelay/releases/tag/v1.0

 

I'll likely expand a bit further on it as well in the near future and increase the functionality, including some of what my other mods are capable of:

  • Unique mob rumours and slay event channel.
  • Death tabs relay.
  • Any other ideas that might be requested.

Screenshots of some of the changes:

 

Timestamps in Discord:

  Reveal hidden contents

B6p6NPO.png

Same messages displayed in game:

  Reveal hidden contents

0aYq96r.png

Upcoming - Currently using a dependent mod with the "library" usage mentioned above to accomplish this:

  Reveal hidden contents

dQPLZfL.png

 

I would still very much prefer a 'Local Server' Freedom relay.

Not every server uses a cluster, and we've become accustomed to using Freedom and not GL-Freedom chat.

Share this post


Link to post
Share on other sites
5 minutes ago, Sindusk said:

New release v1.1:

  • Fixed a bug involving users without a nickname showing up as "null"
  • Add support for non-GL kingdom channels.
  • New "@" annotation instead of "[D]" for discord-to-ingame messaging.

https://github.com/Sindusk/DiscordRelay/releases/tag/v1.1

Is it required to have a Discord channel for GL channels too?

Share this post


Link to post
Share on other sites
1 minute ago, Zera said:

Is it required to have a Discord channel for GL channels too?

No. However, any messages sent in the GL channels in-game will throw an error on the server about null pointer exception. If you're okay to ignore them, the mod will function perfectly fine with just non-GL kingdom channel on Discord.

Share this post


Link to post
Share on other sites

Does this work for a LAN server?  I wanted to try it out somewhere before taking it live on my actual server. I think I created a bot, and I think I got the token info right in the properties file. But when I open Discord, I see no bot.

 

Edited by Batta

Share this post


Link to post
Share on other sites

Does anyone have a bot I could download and use?

Edited by Darkness1990

Share this post


Link to post
Share on other sites

I'm confused about how to set this up.

Drop this in the mods folder. Open the properties file for editing. 

Go to https://discordapp.com/developers/applications/me to make my bot.  Click "Bot"

In the Build-A-Bot section, click Add Bot

Pop-up asks, "Add bot to this server?" Choose "Yes, do it"

Immediately get an error message saying: Too many users have this username, please try another.

I wasn't given any option to create a username...

My Discord server is open.  I already have the Pokecord bot on it.

Now what?

 

OH.  I needed to go change the My application section to the name I wanted my bot to be, before clicking Bot.  Got it.  ?

Edited by Batta

Share this post


Link to post
Share on other sites

Now how do I link my bot to my Discord channel?  

I added the Client secret to the properties file, patched the change. 

But the bot is not on my Discord, and I'm guessing I've missed a step maybe when creating it?

There was some permissions thing, but all it did was give me the number 8 as a result, and I didn't know what to do with that.

 

OK - For the next guy, here's where i found my answer:

https://discordpy.readthedocs.io/en/rewrite/discord.html

 

Edited by Batta
  • Like 1

Share this post


Link to post
Share on other sites

I opened a new server, and my bot stopped working. It is still there, just showing as offline.

I went back and re-did all the bot permissions, and I got a message on Discord saying that the bot had joined the server.

However, the bot remains offline, and I don't know how to make it come back online. 

Anybody know what's wrong here?

 

EDIT:  I figured it out. The properties file asks for the Client Secret, but only works with the actual bot token. 

 

Edited by Batta

Share this post


Link to post
Share on other sites

I am having trouble getting the bot to send any chat from my server to discord. it sends messages from discord to trade and freedom with no problems. it also keeps up to date count of players. any ideas what i am doing wrong?

 

[01:19:44 AM] INFO org.nyxcode.wurm.discordrelay.DiscordRelay: Discord Relay failure: #freedom - [01:19:44] <Gmrezden> test
[01:19:59 AM] INFO org.nyxcode.wurm.discordrelay.DiscordRelay: Discord Relay failure: #trade - [01:19:59] <Gmrezden> (Sto) wtb test
[01:20:33 AM] INFO org.nyxcode.wurm.discordrelay.DiscordRelay: Discord Relay failure: #freedom - [01:20:33] <Gmrezden> test
[01:20:38 AM] INFO org.nyxcode.wurm.discordrelay.DiscordRelay: Discord Relay failure: #gl-freedom - [01:20:38] <Gmrezden> test
[01:21:02 AM] INFO org.nyxcode.wurm.discordrelay.DiscordRelay: Discord Relay failure: #gl-freedom - [01:21:02] <Gmrezden> test
Edited by Rezden

Share this post


Link to post
Share on other sites

Hi, I'm able to get this to work one way only. Messages are sent to my discord fine, but discord messages are not sent to my freedom chat in-game. What am I doing wrong?

 

Edit : fixed by changing discord channel name from freedomisle to freedom

Edited by kronic

Share this post


Link to post
Share on other sites

hi

 

will I be asking you how to put this mode into action step by step?

thx

 

Share this post


Link to post
Share on other sites
5 hours ago, Batta said:

Try this:

 

 

 

yes....I have tried this ... and other procedures here on the forum .... all my done, but when I start/use mod, the server will not start :(

Edited by byxoft

Share this post


Link to post
Share on other sites
16 hours ago, byxoft said:

 

yes....I have tried this ... and other procedures here on the forum .... all my done, but when I start/use mod, the server will not start :(

 

I could suggest things to try, but I don't know how much you already know. Are you experienced with WU mods?

Share this post


Link to post
Share on other sites
13 hours ago, Batta said:

 

I could suggest things to try, but I don't know how much you already know. Are you experienced with WU mods?

yes....i have functional mod: survival, timepay, putontable, mapmod etc. (mapmod - problem i have only with RMI=show players online)

 

discorpmod:

- on wurm server i have mod inserted (and edited by instructions here on forum)

- od discorp web i have created server and bot(edited by instructions here on forum too)

 

and if i RUN WURMSERVER.....start only cmd window and for few seconds is closed all (server aplication do not start)

 

....sry my english :)

Share this post


Link to post
Share on other sites
4 hours ago, byxoft said:

yes....i have functional mod: survival, timepay, putontable, mapmod etc. (mapmod - problem i have only with RMI=show players online)

 

discorpmod:

- on wurm server i have mod inserted (and edited by instructions here on forum)

- od discorp web i have created server and bot(edited by instructions here on forum too)

 

and if i RUN WURMSERVER.....start only cmd window and for few seconds is closed all (server aplication do not start)

 

....sry my english :)

That really does sound like a mod conflict. Maybe try to remove the other mods, then see if the Discord mod works?  If yes, then try adding the other mods back one at a time.

Share this post


Link to post
Share on other sites
19 hours ago, Batta said:

That really does sound like a mod conflict. Maybe try to remove the other mods, then see if the Discord mod works?  If yes, then try adding the other mods back one at a time.

 

ok...i remove all mods ..... no help :(

 

i use server-modlauncher-0.40   is it ok?

Share this post


Link to post
Share on other sites

so...i try everething and with mod: DiscordRelay-2.0 -  application WURMSERVER dont start :(

 

if i use mod: DiscordRelay-v0.2

- application WURMSERVER runs NOPROBLEM....and if i STARTSERVER - BOT on discorp server is online

- on discorp server i add text channels gl-freedom and freedom.....but if i write anything to this channel on discorp or in wurm chat....NOTHING HAPPENS

 

and in command windows is this:

[09:42:59 ODP.] SEVERE org.gotti.wurmunlimited.modloader.server.Listeners: ChannelMessageListener handler for mod DiscordRelay failed
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.LinkedList.checkElementIndex(LinkedList.java:555)
        at java.util.LinkedList.get(LinkedList.java:476)
        at org.nyxcode.wurm.discordrelay.DiscordRelay.onKingdomMessage(DiscordRelay.java:64)
        at org.gotti.wurmunlimited.modloader.server.ServerHook.lambda$fireOnKingdomMessage$10(ServerHook.java:110)
        at org.gotti.wurmunlimited.modloader.server.Listeners.lambda$fire$1(Listeners.java:82)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:479)
        at org.gotti.wurmunlimited.modloader.server.Listeners.fire(Listeners.java:88)
        at org.gotti.wurmunlimited.modloader.server.ServerHook.fireOnKingdomMessage(ServerHook.java:110)
        at org.gotti.wurmunlimited.modloader.server.ProxyServerHook.communicatorChannelHook(ProxyServerHook.java:248)
        at com.wurmonline.server.creatures.Communicator.reallyHandle_CMD_MESSAGE(Communicator.java:6447)
        at com.wurmonline.server.creatures.Communicator.reallyHandle(Communicator.java:2406)
        at com.wurmonline.communication.SocketConnection.tick(SocketConnection.java:618)
        at com.wurmonline.communication.SocketServer.tick(SocketServer.java:172)
        at com.wurmonline.server.Server.run(Server.java:2515)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

 

 

 

pls help

Share this post


Link to post
Share on other sites

have you add the correct bot token and have the bot joined your discord server?

Edited by Eject

Share this post


Link to post
Share on other sites
On 12/24/2018 at 7:22 AM, Eject said:

have you add the correct bot token and have the bot joined your discord server?

 

 

yes....all i have correct

 

 

finally i try ALL versions DiscorpRelay MOD.....and one of them working

Share this post


Link to post
Share on other sites

Would it be within scope to have properties specifying the channel name for connected players, trade, mgmt, and CA help?

(Only rumors has this option for some reason.)

Share this post


Link to post
Share on other sites

Hi! When starting the server, an error occurs. Version mod 3.0.

[12:56:11 PM] SEVERE org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher: mod/sin/lib/Prop
java.lang.NoClassDefFoundError: mod/sin/lib/Prop
	at org.nyxcode.wurm.discordrelay.DiscordRelay.configure(DiscordRelay.java:102)
	at org.gotti.wurmunlimited.modloader.ModLoaderShared.lambda$loadModsFromModDir$4(ModLoaderShared.java:156)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.gotti.wurmunlimited.modloader.ModLoaderShared.loadModsFromModDir(ModLoaderShared.java:154)
	at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at javassist.Loader.run(Loader.java:286)
	at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at PatchedLauncher.main(PatchedLauncher.java:20)
Caused by: java.lang.ClassNotFoundException: mod.sin.lib.Prop
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at javassist.Loader.delegateToParent(Loader.java:431)
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager$1.delegateToParent(HookManager.java:174)
	at javassist.Loader.loadClass(Loader.java:311)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 24 more

 

Share this post


Link to post
Share on other sites
On 6/9/2019 at 1:26 AM, AldGM said:

Hi! When starting the server, an error occurs. Version mod 3.0.


[12:56:11 PM] SEVERE org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher: mod/sin/lib/Prop
java.lang.NoClassDefFoundError: mod/sin/lib/Prop
	at org.nyxcode.wurm.discordrelay.DiscordRelay.configure(DiscordRelay.java:102)
	at org.gotti.wurmunlimited.modloader.ModLoaderShared.lambda$loadModsFromModDir$4(ModLoaderShared.java:156)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.gotti.wurmunlimited.modloader.ModLoaderShared.loadModsFromModDir(ModLoaderShared.java:154)
	at org.gotti.wurmunlimited.serverlauncher.DelegatedLauncher.main(DelegatedLauncher.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at javassist.Loader.run(Loader.java:286)
	at org.gotti.wurmunlimited.serverlauncher.ServerLauncher.main(ServerLauncher.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at PatchedLauncher.main(PatchedLauncher.java:20)
Caused by: java.lang.ClassNotFoundException: mod.sin.lib.Prop
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at javassist.Loader.delegateToParent(Loader.java:431)
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager$1.delegateToParent(HookManager.java:174)
	at javassist.Loader.loadClass(Loader.java:311)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 24 more

 

 

You have something installed on your server that requires SinduskLibrary and it cannot locate the .properties file for it: You can download it here:

 

https://github.com/Sindusk/sindusklibrary/releases

 

The error is really due to that, not discord relay, but it comes up because of the sharedclassloader=true I believe.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this