Velocity global chat/discord bridge

Overview

VelocityDiscord

Velocity global chat/discord bridge

Default config generated on startup:

# Don't change this
config_version="1"

[discord]
# Bot token from https://discordapp.com/developers/applications/
token="TOKEN"
# Channel ID to send minecraft chat messages to
channel="000000000000000000"

# Show messages from bots in minecraft chat
show_bot_messages=true
# Show clickable links for attachments in minecraft chat
show_attachments_ingame=true

# Minecraft > Discord message formats
# Uses the same formatting as the Discord client
[discord.chat]
message="{username}: {message}"
join_message="**{username} joined the game**"
leave_message="**{username} left the game**"
server_switch_message="**{username} moved to {current} from {previous}**"

# Discord > Minecraft message formats
# Uses XML-like formatting with https://docs.adventure.kyori.net/minimessage#format
[minecraft]
discord_chunk="<dark_gray>[<{discord_color}>Discord<dark_gray>]<reset>"
username_chunk="<{role_color}><hover:show_text:{username}#{discriminator}>{nickname}</hover><reset>"
message="{discord_chunk} {username_chunk}<dark_gray>: <reset>{message} {attachments}"
attachments="<dark_gray><click:open_url:{url}>[<{attachment_color}>Attachment<dark_gray>]</click><reset>"
Comments
  • What for is GUILD_MEMBERS and the Server Members Intent needed?

    What for is GUILD_MEMBERS and the Server Members Intent needed?

    GatewayIntent.GUILD_MEMBERS is required here: https://github.com/fooooooooooooooo/VelocityDiscord/blob/master/src/main/java/ooo/foooooooooooo/velocitydiscord/discord/Discord.java#L60. What for?

    opened by voruti 4
  • [Feature] Command to list players on all servers / specific server

    [Feature] Command to list players on all servers / specific server

    It would be nice to have a command to list the (number of) players on all servers and/or each specific server. Optimally this command would be available on both Discord and Minecraft.

    Examples:

    /list
    
    [server1 3/20]
    - player1
    - player2
    - player3
    
    [server2 2/24]
    - player4
    - player5
    
    [server3 0/40]
    No one is online
    
    /list server1
    
    [server1 3/20]
    - player1
    - player2
    - player3
    

    The numbers after the server name would be #current players (out of) #max players allowed - though this may get tricky with plugins that spoof this.

    ~~(Off-topic - would [{username}@{current}] {message} be the correct way to prefix a player's message with the player's current server? Ex. [player4@server2] hello world)~~ See https://github.com/fooooooooooooooo/VelocityDiscord/issues/2 (Also, is this plugin compatible with "global chat" plugins such as chat or ChatRegulator?)

    This is the only Velocity - Discord bridge kept up-to-date, so I really appreciate your work on this :)

    opened by unilock 4
  • Show player count as activity

    Show player count as activity

    This PR adds:

    Showing the current amount of players connected to the proxy as Discord activity. The text/amount gets updated in method updateActivityPlayerAmount() which will be called when the bot is "ready" (initialize) or a player joined or left the game (regular updates). The activity text is configurable in the config.

    Screenshot:

    activity ("Spielt" is "is playing" - Discord uses localized texts & my Discord client is setup with the German language.)

    opened by voruti 3
  • [Bug/Compatibility] Joining server message incorrect

    [Bug/Compatibility] Joining server message incorrect

    With the config line

    [discord.chat]
    join_message = "*{username} joined {server}*"
    

    the wrong server is output in Discord. It shows the default server (lobby) instead of the server I'm actually joining. I'm using this plugin to rejoin the last server I was connected to: https://github.com/Matt-MX/ReconnectVelocity

    opened by voruti 3
  • Make /list command ephemeral

    Make /list command ephemeral

    I suggest making the /list command ephemeral. This is showing the response to the command only to the person that invoked it. I think that would be better to prevent spamming of Discord channels.

    opened by voruti 2
  • Allow customization of webhook username

    Allow customization of webhook username

    This commit allows the webhook username to be customized via the plugin config. Specifically, it adds a key "discord.webhook.webhook_username" to config.toml that is interpreted as the format of the webhook's username, replacing the variables {username} and {server} with the username and current server, respectively, of the player sending a Minecraft chat message.

    Example: [{server}] {username} = [vanilla] player1

    I also took the liberty of reformatting the default config file, so feel free to crucify me for that :) (on that note, it might be a good idea to reformat the config file (even more!) to make it more readable, but I figure I've gone far enough already)

    Also, I merged the server connect methods, using ServerConnectedEvent rather than PlayerChooseInitialServerEvent and ServerPostConnectEvent separately. This fixes #11.

    opened by unilock 0
  • [Feature] Allow using

    [Feature] Allow using "{current}" variable in other contexts

    Currently you can only use the {previous} and {current} variables in the server_switch_message. However, it would be useful to be able to use these variables in other messages, especially the latter.

    Some examples: ({username} = "player", {current} = "vanilla", {previous} = "modded")

    ~

    This works fine:

    server_switch_message="**{username} moved from {previous} to {current}**"
    

    Result:

    player moved from modded to vanilla

    ~

    This does not work:

    join_message="**{username} joined {current}**"
    

    Result:

    player joined {current}

    Desired result:

    player joined vanilla

    ~

    Another case where this would be useful:

    message="[{username}@{current}] {message}"
    

    Desired result:

    [player@vanilla] hello, world

    opened by unilock 0
  • [Bug] Discord -> Minecraft bridge not working - `failed to get member: <member_id>`

    [Bug] Discord -> Minecraft bridge not working - `failed to get member: `

    When a Discord message is sent, it does not show in the Minecraft chat, and the following is printed to Velocity's log:

    [JDA MainWS-ReadThread/WARN]: failed to get member: <member_id>
    

    (with <member_id> being the ID of the Discord member sending the message)

    I was able to fix this by reverting https://github.com/fooooooooooooooo/VelocityDiscord/commit/c07d0df460453e56640aef78bcaccb2d6c40f327 - but I'm not sure that was the cause, since I haven't done much testing...

    Note that nothing has been changed in terms of the Discord bot itself (entitlements, server permissions, etc.) since prior to this issue, and that the Minecraft -> Discord bridge has been working fine all the while.

    opened by unilock 2
  • [Feature] Pingable Discord users

    [Feature] Pingable Discord users

    As the title says: E.g. writing "Hi @[some Discord name]" in Minecraft chat and the person will receive a Discord ping.

    Further ideas:

    • config option to enable/disable this feature
    • distinguish usernames versus server nicknames?
    opened by voruti 0
  • [Bug] `/list` command fails if a backend server cannot be pinged

    [Bug] `/list` command fails if a backend server cannot be pinged

    In my Velocity config, I have a test server defined that I'm not always running. If the /list command fails to ping a server, it dies on an exception.

    [12:16:09] [JDA MainWS-ReadThread/ERROR]: One of the EventListeners had an uncaught exception
    java.lang.RuntimeException: java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /127.0.0.1:44444
    	at ooo.foooooooooooo.velocitydiscord.discord.commands.ListCommand.handle(ListCommand.java:36) ~[?:?]
    	at ooo.foooooooooooo.velocitydiscord.discord.Discord.onSlashCommandInteraction(Discord.java:187) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:382) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:170) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleCommand(InteractionCreateHandler.java:109) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:80) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:953) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:840) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:818) ~[?:?]
    	at velocitydiscord.net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:992) ~[?:?]
    	at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385) ~[?:?]
    	at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276) ~[?:?]
    	at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996) ~[?:?]
    	at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755) ~[?:?]
    	at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108) ~[?:?]
    	at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) ~[?:?]
    	at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) ~[?:?]
    Caused by: java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /127.0.0.1:44444
    	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
    	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?]
    	at ooo.foooooooooooo.velocitydiscord.discord.commands.ListCommand.handle(ListCommand.java:33) ~[?:?]
    	... 20 more
    Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /127.0.0.1:44444
    Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
    	at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.channel.unix.Socket.finishConnect(Socket.java:321) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:477) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:385) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity-3.1.2-SNAPSHOT-175.jar:3.1.2-SNAPSHOT (git-4b33d5fb-b175)]
    	at java.lang.Thread.run(Thread.java:833) [?:?]
    

    I propose that servers defined in Velocity's config that cannot be pinged be present in the /list command with something like "Server cannot be reached" in place of the player list.

    opened by unilock 4
Releases(1.2.1)
Owner
Foo
:)
Foo
This is a Velocity plugin that makes it possible to host a modern forge server behind a Velocity proxy!

Ambassador This is a Velocity plugin that makes it possible to host a modern forge server behind a Velocity proxy! Unlike other solutions, this plugin

Adrian Bergqvist 31 Dec 28, 2022
Fixes Minecraft client lag from receiving chat messages, at the expense of not being able to block players in chat.

chat-lag-fix Fixes Minecraft client lag from receiving chat messages, at the expense of not being able to block players in chat. Mojang in their infin

adryd 21 Dec 4, 2022
NoChatLag fixes lagspikes caused by chat by removing the sender UUID from the chat packet. Please note that this breaks the vanilla client side block list.

NoChatLagServer Fabric Version | Forge Version Downloads: SpigotMC | GitHub Releases NoChatLagServer fixes WEB-5587 by setting the sender-uuid to that

Noah van der Aa 3 Jan 10, 2022
GalaxyCDC is a core component of PolarDB-X which is responsible for global binary log generation, publication and subscription.

中文文档 What is ApsaraDB GalaxyCDC ? GalaxyCDC is a core component of PolarDB-X which is responsible for global binary log generation, publication and su

null 56 Dec 19, 2022
Fabric mod to (maybe) ignore global bans while still using the auth server

=== SECURITY WARNING === DO NOT USE THIS MOD IF YOU DO NOT 100% TRUST THE SERVER NOT TO STEAL YOUR ACCOUNT. This mod is not secure because servers wil

null 15 Dec 20, 2022
A Spigot Plugin that connects your server chat with a discord channel

Minecord A Spigot Plugin that connects your server chat with a discord channel. Features Connects your in game chat with a channel on your discord ser

EPS-DEV 1 Apr 3, 2022
Aliucord - Discord Android app mod inspired by desktop Discord client mods.

Aliucord Aliucord is a modification for the Android Discord app inspired by desktop client modifications. Unlike other Android Discord app modificatio

null 2k Dec 31, 2022
Stetho is a debug bridge for Android applications, enabling the powerful Chrome Developer Tools and much more.

Stetho Stetho is a sophisticated debug bridge for Android applications. When enabled, developers have access to the Chrome Developer Tools feature nat

Meta 12.6k Jan 3, 2023
Literally just adds milk, to act as a bridge for any other mods that want to do the same.

Milk lib Literally just adds milk, to act as a bridge for any other mods that want to do the same. See the Milk class for customisation; It allows for

null 5 Oct 17, 2022
Simple Design for Java bridge with Javascript. Also can get javascript console.log.

SDBridgeKotlin is here. If your h5 partner confused about how to deal with iOS and Android. This Demo maybe help. 最常见的问题. WebViewJavascriptBridge is n

null 25 Dec 18, 2022
LimboAuth - Minecraft Auth System for Velocity proxy built in virtual server (Limbo).

LimboAuth Auth System built in virtual server (Limbo). MC-Market SpigotMC.org Описание и обсуждение на русском языке (spigotmc.ru) Описание и обсужден

Elytrium 89 Jan 4, 2023
Mirror of Apache Velocity Engine

Title: Apache Velocity Engine Apache Velocity Welcome to Apache Velocity Engine! Apache Velocity is a general purpose template engine written in Java.

The Apache Software Foundation 298 Dec 22, 2022
MiniMessage Component-based Placeholders for PaperMC and Velocity platforms

MiniMessage Component-based Placeholders for PaperMC and Velocity platforms

null 10 Dec 28, 2022
Protect your Spigot server against IP forwarding exploits, as well as blocking unknown BungeeCord and/or Velocity proxies.

Sentey Protect your Spigot server against IP forwarding exploits, as well as blocking unknown BungeeCord and/or Velocity proxies. But firewalls are a

ComuGamers Network 18 Dec 28, 2022
Make the Velocity proxy run commands based on backend input.

Command Sync Server This plugin allows the Velocity proxy to run commands based on backend input. Purpose The purpose of this is to allow easy access

Wind Development 3 May 23, 2022
Plugin for Spigot, PaperMC, BungeeCord and Velocity to create custom MOTDs, playercount message and playercount hover with priorities and conditions.

AdvancedServerList AdvancedServerList is a server and proxy plugin that allows you to create custom MOTDs and more in your server list with priority a

Andre_601 19 Dec 14, 2022
A MOTD plugin for Velocity that caches network packets. This helps it be the fastest one of the MOTD plugins.

FastMOTD A MOTD plugin for Velocity that catches network packets. This helps it be the fastest one of the MOTD plugins. Test server: ely.su Features F

Elytrium 19 Dec 24, 2022
A hybrid chat android application based on the features of Instagram and Whatsapp having UI just as Telegram.

GupShup About App It is a free online chat android application, enabling user to create a free user account and then log in using the credentials. Aft

Ratik Tiwari 1 May 22, 2022
Una aplicacion de Chat en Spring Boot

websockets-spring-boot-angular-sockjs-chatapp-bootstrap Una aplicacion de Chat en Spring Boot, Angular, Bootstrap y SockJS Puedes ver el video de la d

Jose David Briones Rosa 4 Dec 11, 2022