Giter VIP home page Giter VIP logo

huskchat's Introduction

HuskChat
Spigot Setup Docs Issues


HuskChat is a no-frills, simple and customisable chat system for Minecraft networks. It supports both running on BungeeCord and Velocity frontend servers for cross-server chat, or on a single-server Spigot setup.

It's designed to be easy to configure with an elegant out-of-box setup, while also being highly configurable, suiting a variety of use cases by allowing you to define channels and manage who can send and receive messages within them.

Features

⭐ Works great out of the box — Install on your Spigot server or Velocity/BungeeCord-based proxy and use right away

⭐ Placeholder support — Hooks with LuckPerms to display user roles, PAPI support via PAPIProxyBridge

⭐ Private messaging — Private messages—including group DMs&mdash and replying, admin spy features

⭐ Fine-tune channels — Set send/receive permissions for channels, send messages to a discord webhook, filter & more!

⭐ Quick and easy to use — Super simple set of commands. Define channel shortcut commands, too!

⭐ Advanced profanity checking — Machine learning powered profanity filter

⭐ Filters & replacers — Customisable spam limiting filter, anti-advertising & special emoji

⭐ Modern formatting — Utilise modern formatting, with RGB and Gradient support via MineDown

Building

To build HuskChat, you'll need python (>=v3.6) with associated packages installed; jep and alt-profanity-check. You can install these with pip install jep and pip install alt-profanity-check. These are needed to run the profanity filter tests.

Then, simply run the following in the root of the repository:

./gradlew clean build

License

HuskChat is licensed under the Apache 2.0 license.

Translations

Translations of the plugin locales are welcome to help make the plugin more accessible. Please submit a pull request with your translations as a .yml file.

Links


© William278, 2024. Licensed under the Apache-2.0 License.

huskchat's People

Contributors

10935336 avatar 4drian3d avatar 65-7a avatar ceddix avatar dependabot[bot] avatar heron4gf avatar ironboundred avatar izatwin avatar jhqwqmc avatar jumento avatar jurienhamaker avatar malzsmith avatar notjoshmiles avatar passolargo76 avatar qartho avatar truewinter avatar ultard avatar wiiiiam278 avatar wirayuda5620 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

huskchat's Issues

channel permission does not work when the Luckperms context is set

Hello! I have a situation while using the plugin
Bungeecord server, When context is set for channel permission, Permission check is not work.
For example huskchat.channel.lobby.send true server=lobby
Detects correctly when no context is set
Whatever players inherit permissions or give permission
[I used a translator, sorry]

20230209020420

lobby:
    format: "&r&f%fullname%&r&7: &r"
    broadcast_scope: GLOBAL
    log_to_console: true
    filtered: false
    permissions:
      send: huskchat.channel.lobby.send
      receive: huskchat.channel.lobby.receive
    restricted_servers:
    - skyblock

Server version 1.19.3, HuskChat-2.4.1, Luckperms installation in proxies and servers use mysql
Thank you so much!

formatting codes don't work in the console

formatting codes set in config.yml don't get set in console.

image

I thought it might be a console issue. but other plugins work fine and apply the formatting codes set in their configs.

[Feature Request] Global Join and Leave messages

Currently, join and leave messages are displayed in chat whenever someone moves servers inbetween the network.

Since HuskChat creates a global chat, if someone moves to another server of the network, it looks like they are leaving the network.

It would be very useful to have a global join and leave message for when someone joins and leaves the whole network.
This message could be customized in the config.yml.

[Feature request] add RedisBungee support

Now RedisBungee already supports Velocity (RedisBungee-Velocity), but now any cross-proxy chat plugin that supports redis is based on BungeeCord or Bukkit

HuskChat supports Velocity, can you add redis function to realize chat with multiple proxy instances?

player-info-forwarding-mode = "modern" in Velocity configuration

GroupManager permission plugin support

Great plugin but Is it possible to make this work with GroupManager? Not a fan of lucky perms a lot of people still use groupmanager I was told to post about this here.

Compatibility issue with Bukkit Conversation API

Seeking input for PikaMug/Quests#1594 (which affects both HuskChat and now-outdated BungeeChat).

With HuskChat installed on a Bungee server and Quests installed on a Spigot/Paper server, it is not possible to hold a conversation. For example, using /quests editor and selecting option 1 will prompt the user to enter a name. This typically works fine, but HuskChat seems to override the functionality and simply displays the reply in chat. This does not occur on Bungee servers without HuskChat installed.

ClassCastException when attempting to message zero-length player names

The matchPlayer function used by the messenger can have a zero-length player name passed to it, either through:

  • /msg hello (double space indicating a zero-length player argument)
  • /msg User1,,User3 (a zero-length player in a group private message).

This will throw the following error:

java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to invoke command msg  test for [connected player] [Redacted] (/127.0.0.1:63246)
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?]
        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) [?:?]
Caused by: java.lang.RuntimeException: Unable to invoke command msg  test for [connected player] [Redacted] (/127.0.0.1:63246)
        at com.velocitypowered.proxy.command.VelocityCommandManager.executeImmediately0(VelocityCommandManager.java:223) ~[velocity.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
        at com.velocitypowered.proxy.command.VelocityCommandManager.lambda$executeImmediatelyAsync$1(VelocityCommandManager.java:248) ~[velocity.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        ... 3 more
Caused by: java.lang.ClassCastException: class com.velocitypowered.proxy.connection.client.ConnectedPlayer cannot be cast to class java.lang.Comparable (com.velocitypowered.proxy.connection.client.ConnectedPlayer is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')
        at java.util.Comparators$NaturalOrderComparator.compare(Comparators.java:47) ~[?:?]
        at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) ~[?:?]
        at java.util.TimSort.sort(TimSort.java:220) ~[?:?]
        at java.util.Arrays.sort(Arrays.java:1307) ~[?:?]
        at java.util.ArrayList.sort(ArrayList.java:1721) ~[?:?]
        at java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:392) ~[?:?]
        at java.util.stream.Sink$ChainedReference.end(Sink.java:258) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]
        at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]
        at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]
        at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]
        at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]
        at net.william278.huskchat.velocity.HuskChatVelocity.matchPlayer(HuskChatVelocity.java:240) ~[?:?]
        at net.william278.huskchat.message.PrivateMessage.dispatch(PrivateMessage.java:40) ~[?:?]
        at net.william278.huskchat.command.MsgCommand.onExecute(MsgCommand.java:38) ~[?:?]
        at net.william278.huskchat.velocity.command.VelocityCommand.execute(VelocityCommand.java:27) ~[?:?]
        at net.william278.huskchat.velocity.command.VelocityCommand.execute(VelocityCommand.java:13) ~[?:?]
        at com.velocitypowered.proxy.command.registrar.InvocableCommandRegistrar.lambda$createLiteral$1(InvocableCommandRegistrar.java:81) ~[velocity.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[velocity.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
        at com.velocitypowered.proxy.command.VelocityCommandManager.executeImmediately0(VelocityCommandManager.java:210) ~[velocity.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
        at com.velocitypowered.proxy.command.VelocityCommandManager.lambda$executeImmediatelyAsync$1(VelocityCommandManager.java:248) ~[velocity.jar:3.1.2-SNAPSHOT (git-f0ea638f-b122)]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        ... 3 more

Social and Local Spy not exempting Authors and recipients

The local spy and Social Spy commands do not appear to have any mechnism to exempt players who send the PMs or receive them, when they possess the permission, from receiving a Spy message themselves.

This may cause confusion and may cause unnecessary spam inside chat...

GLOBAL_PASSTHROUGH setting breaks emojis

On HuskChat the global_passthrough setting does not allow the use of emojis when global does
GLOBAL_PASSTHROUGH:
javaw_WBuQrptdaq

GLOBAL:
image

Turning off ASCII filter does NOT change anything

Plugins which require chat input are not compatible with HuskChat

It has been observed, that any plugin (verified with CommandPanels and BankPlus), which requires chat input is not compatible with HuskChat. Input from the chat is completely ignored.

Preconditions:

Repro Steps:

  1. Login to the server.
  2. Type /bank.
  3. Click Deposit-Custom.
  4. Type the amount of money to deposit.
  5. Observe the issue as the number is ignored.

Plugin fails to load on latest Velocity

Using the latest build of Velocity (3.1.2 build 153) the plugin throws an error during startup. Global chat does not appear to work at all.

[18:11:40 ERROR]: Couldn't pass ProxyInitializeEvent to huskchat java.lang.NullPointerException: Cannot invoke "java.util.List.add(Object)" because the return value of "java.util.Map.get(Object)" is null at net.william278.huskchat.config.Settings.fetchChatFilters(Settings.java:267) ~[?:?] at net.william278.huskchat.config.Settings.load(Settings.java:121) ~[?:?] at net.william278.huskchat.velocity.HuskChatVelocity.reloadSettings(HuskChatVelocity.java:162) ~[?:?] at net.william278.huskchat.velocity.HuskChatVelocity.onProxyInitialization(HuskChatVelocity.java:93) ~[?:?] at net.william278.huskchat.velocity.Lmbda$6.execute(Unknown Source) ~[?:?] at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:47) ~[velocity.jar:3.1.2-SNAPSHOT (git-74edac96-b153)] at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:598) ~[velocity.jar:3.1.2-SNAPSHOT (git-74edac96-b153)] at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:479) ~[velocity.jar:3.1.2-SNAPSHOT (git-74edac96-b153)] 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) [?:?]

LOCAL_PASSTHROUGH and GLOBAL_PASSTHROUGH only passthrough and don't broadcast messages

Affects Velocity 1.19, but I think this also will affect BungeeCord. Unrelated to MC 1.19 chat changes.

Caused by these lines which were changed to allow pass-through chat to work without spoofing:

final Player player = VelocityPlayer.adaptCrossPlatform(e.getPlayer());
Channel channel = Settings.channels.get(PlayerCache.getPlayerChannel(player.getUuid()));
if (channel.broadcastScope.isPassThrough) {
if (!ChatMessage.passesFilters(plugin, player, new StringBuilder(e.getMessage()), channel)) {
e.setResult(PlayerChatEvent.ChatResult.denied());
}
return;
}

All pass-through scoped messages will only be filtered and passed through, including global and local passthrough scoped messages, which should additionally be dispatched locally/globally over the proxy. The return; prevents this. Easy solution of course would be to check for the local and global passthrough scopes just before the return and dispatch that way, but that breaks the repeat filter as stuff will go through the filters twice. Probably needs some slight refactoring to avoid messy checks

Add "!" at the beginning of the message for global

Some players find it difficult to enter the /global and /local command every time

They are more used to typing "!" at the beginning of the message for global, and for local without "!" at the beginning.

This feature would be very useful, I would be very grateful if it would be added.

[Feature Request] Custom server name

Your plugin is great!
No need to install on the server to use, this solved my fabric server chat problem.
I'm wondering if it's possible to customize the server name further, in Multichat I customized the shorter server name, which looks great.
But it seems that only %servername% can be used in HuskChat, is it possible to customize the server name, thanks a lot.

1.19 support: Chat spoofing is not supported on this client version error - change passthrough implementation

Chat spoofing was quietly deprecated in BungeeCord for Minecraft 1.19, meaning the plugin spits out an exception on that platform when using passthrough chat on v1.19+. (SpigotMC/BungeeCord#3327).
Instead on relying on ProxiedPlayer#chat() to pass through chat to backends, the event should instead just not be cancelled (unless it doesn't satisfy a filter's requirements). Downside of this of course is that it means chat replacers (emoji) won't be able to be passed - but that's a reasonable concession imo.
Velocity (and maybe Bungee) will probably provide API (Velocity might have already added this actually) letting us do a "chat preview", should also add support for this when that API gets added so players can see how their message will appear.

Jep library loading error when setting a path manually for profanity checker

Relevant logs
10:04:09 [WARNING] Exception encountered when loading plugin: HuskChat
java.lang.RuntimeException: Failed to initialize ProfanityChecker (Jep.setJepLibraryPath(...) called after initializing python interpreter.)Please ensure that the jep library is installed and the library path is correct. Consult the HuskChat docs for more 
information on this error.
    at net.william278.huskchat.filter.ProfanityFilterer.initialize(ProfanityFilterer.java:38)
    at net.william278.huskchat.filter.ProfanityFilterer.<init>(ProfanityFilterer.java:28)
    at net.william278.huskchat.config.Settings.fetchChatFilters(Settings.java:301)
    at net.william278.huskchat.config.Settings.load(Settings.java:149)
    at net.william278.huskchat.bungeecord.HuskChatBungee.reloadSettings(HuskChatBungee.java:179)
    at net.william278.huskchat.bungeecord.HuskChatBungee.onEnable(HuskChatBungee.java:84)
    at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:265)    at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)    at net.md_5.bungee.BungeeCord.start(BungeeCord.java:295)

    at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
Caused by: java.lang.IllegalStateException: Jep.setJepLibraryPath(...) called after initializing python interpreter.
    at jep.MainInterpreter.setJepLibraryPath(MainInterpreter.java:287)
    at net.william278.huskchat.libraries.profanitycheckerapi.ProfanityChecker.initialize(ProfanityChecker.java:81)
    at net.william278.huskchat.libraries.profanitycheckerapi.ProfanityChecker.<init>(ProfanityChecker.java:63)
    at net.william278.huskchat.libraries.profanitycheckerapi.ProfanityCheckerBuilder.build(ProfanityCheckerBuilder.java:84)
    at net.william278.huskchat.filter.ProfanityFilterer.initialize(ProfanityFilterer.java:35)
    ... 9 more

formatting codes at the end of message format settings aren't set

In the config.yml of HuskChat you have the possibility to change the format of some messages/channels (e.g. under channels.<channel>.format or message_command.format).

Previously, if there was a formatting code at the end of this string, it was used for the message that followed. But this isn't the case anymore.

For example, my config looks like this:

channels:
  staff:
    format: '&c+++ %fullname%&f:&c '
    broadcast_scope: GLOBAL
    log_to_console: true
    filtered: false
    permissions:
      send: 'huskchat.channel.adminchat.send'
      receive: 'huskchat.channel.adminchat.receive'
    shortcut_commands:
      - /ac

But the output looks like this:
image

It seems like the message simply doesn't get formatted (&r).

The error should be somewehere here, because the message is just appended so I guess the format doesn't get applied to it.

Buggy tab complete for group messages

If sending a message to multiple people whose names start with the same letters (and case), the tab completion cuts off the first person's name.

IPfPOdXf4R.mp4

[feature request] Improve message replacers

Chat message replacer options currently seem to support single characters only. This works great for using basic emojis like :skull: for 💀
It would be great if longer replacements were available, so a :tableflip: could be done resulting in (╯°□°)╯︵ ┻━┻ or a :shrug: for ¯\_(ツ)_/¯

I would be very glad if you implemented this function, as a functional chat plugin is my last step in migrating to velocity, and I would be very happy to choose HuskChat as my option.

Message moderation/hiding

As opposed to or in conjunction with #64

This is possible in 1.19:

Custom servers can hide player chat messages from display via a new network packet

per rank format

i can edit the formats per channel, but what about per rank? that's literally a must feature if it's not here, definitely add it ASAP

Group PM System

This feature requests is for the implementation of a Group PM system to be added, working in a way to allow users to setup "groups" within HuskChat to send messages to with each other.

A few key notes:

  • Players should be able to toggle into groupMSG "channels" so to speak; this way they don't need to redo the entire command each time
  • The command should have a different reply and send command. Even if it only adds a "g" it makes it distinct
  • Players should be able to set there own tag and color for it universally or have the server admin set a global format for it

[Feature Request] /ignore feature

Request for a new command feature:
With our old chat solution players had an option to ignore other players in chat. When typing /ignore followed by a username, messages from that certain player would be permanently hidden for the player executing the command.

Some of our players are complaining about that feature missing, so it would be a really nice addition to the plugin.
Greets!


Some peeps just get on each others nerves and are better off being able to ignore each other.

  • /ignore playername
  • /unignore playername
  • /ignore list (to list players you're ignoring)
  • /ignore list name (for staff/OP to see others ignore lists)

Thanks for considering.

“Radio” Broadcasting Channel

This is a feature request which will add a type of broadcasting channel to HuskChat. With this players will be able to select channels which will allow them to see broadcasts within a certain radius of blocks.

[Feature request] Chat ping!

It would be cool to have the ability to enable a ping feature in the config, when someone says your IGN in chat you hear a little sound!

And there could also be a settings to put a color on it so your IGN in the message would be a different color that you could chose in the config to make it more noticeable, kind of like a highlighting.

broken

broken no work bcuz bad

Change the chat color

Be able to change the chat color (Or make it possible that u can turn off HuskChat is overrulling the chat formatter).
We have a chat color plugin that doesn't work anymore, and we dont want the chat color to be white.

[Feature Request] Add /clearchat command

Hey, I think a /clearchat command would be extremely handy and quite important for a chat plugin. Especially when someone sends messages that should be deleted.

I would make the command look like this: /clearchat [self/all/<channel>] (I think what does what is self-explanatory)

Platform inconsistency with server switch default channel handling causing invalid handling of contextual channel access permissions

The default channels per server feature has an inconsistent implementation between Bungee and Velocity.

The event that runs the operation to switch the player's channel is meant to fire after the user has changed servers, but on Bungee the event "is called once a connection to a server is fully operational, and is about to hand over control of the session to the player" whereas on Velocity the event "is fired once the player has successfully connected to the target server and the connection to the previous server has been de-established."

On servers that restrict channels per-server with contextual permissions, this causes an issue on Bungee it seems as LuckPerms does not treat the player as having the new server context at the point this is invoked. I have not tested Velocity.

Relevant code:

Bungee

@EventHandler(priority = EventPriority.HIGH)
public void onPlayerChangeServer(ServerConnectedEvent e) {
final String server = e.getServer().getInfo().getName();
final BungeePlayer player = BungeePlayer.adaptCrossPlatform(e.getPlayer());
handlePlayerSwitchServer(player, server, plugin);
}

Velocity

@Subscribe
public void onPlayerChangeServer(ServerConnectedEvent e) {
final String server = e.getServer().getServerInfo().getName();
final VelocityPlayer player = VelocityPlayer.adaptCrossPlatform(e.getPlayer());
handlePlayerSwitchServer(player, server, plugin);
}

Implementing logic

public final void handlePlayerSwitchServer(Player player, String newServer, HuskChat implementor) {
if (Settings.serverDefaultChannels.containsKey(newServer)) {
PlayerCache.switchPlayerChannel(player, Settings.serverDefaultChannels.get(newServer),
implementor.getMessageManager());
} else {
for (Channel channel : Settings.channels.values()) {
if (channel.id.equalsIgnoreCase(PlayerCache.getPlayerChannel(player.getUuid()))) {
for (String restrictedServer : channel.restrictedServers) {
if (restrictedServer.equalsIgnoreCase(newServer)) {
PlayerCache.switchPlayerChannel(player, Settings.defaultChannel,
implementor.getMessageManager());
break;
}
}
break;
}
}
}
}

Luckperms Group Permission Issue

It looks like the plugins permissions (tested for staff chat default permissions) doesn't work with luckperms proxy setup when added to a group instead of a player.

Tested on Purpur 1.17.1 with Waterfall 1.17.1 and HuskChat 1.0.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.