DiscordSRV

DiscordSRV

86.8k Downloads

Colors not replacing in VentureChat ChatChannelHookMessageFormat

Androkai opened this issue · 11 comments

commented

Normal ChatChannelHookMessageFormat is:
ChatChannelHookMessageFormat: "%channelcolor%[%channelnickname%]&r %message%"

With VentureChat (only tested with it till now) I have to replace & with § to make it work:
ChatChannelHookMessageFormat: "%channelcolor%[%channelnickname%]§r %message%"

I also use colorcodes I had to replace for my own format:
ChatChannelHookMessageFormat: "§8[%channelcolor%%channelnickname%§8]§r %message%"

Maybe this also have to be done for other chatchannel-plugins (needs testing).

The second problem is that Venturechat define color as text within config which is normally replaced later but in combination with DiscordSRV this doesn't work and results in something like that:

DiscordSRV-config:

ChatChannelHookMessageFormat: "§8[%channelcolor%%channelnickname%§8]§r %message%"

VentureChat-config:

channels:
  Admin:
    color: red
    chatcolor: red
    mutable: false
    filter: false
    autojoin: true
    default: false
    distance: 0
    cooldown: 0
    bungeecord: false
    alias: a
    permissions: adminchannel
    format: '&f[&cAdmin&f] {prefix} {nickname}&c:'
    irc: false

Output:
Output

"red" as the channelcolor in front of channelnickname (which is short "a" for AdminChannel) is no longer replaced correctly. I also experimented with using &c or §c in the VentureChat-config but this doesn't work at all.

commented

test f77f251 1a6cf7a & tell results

commented

Doesn't work. Same output but without any color now.

commented

..?

commented

Output:
output

Log-entry:

[20:19:52 INFO]: [DiscordSRV] Chat:  §8[§4TestingTeam§8(§9Discord§8)] §bAndrokai§f: §2Test
commented
commented

Replaces & now correctly. Now a solution for VentureChat`s string-colorvariables (red, gold, ...) and it's perfect.

commented
commented

Looks like it needs to be replaced with caps.

[21:10:34 WARN]: [21:10:34] [Fatal] [JDA]: One of the EventListeners had an uncaught exception
[21:10:34 WARN]: [21:10:34] [Fatal] [JDA]: Encountered an exception:
[21:10:34 WARN]: [21:10:34] [Fatal] [JDA]: java.lang.IllegalArgumentException: No enum constant org.bukkit.ChatColor.red
        at java.lang.Enum.valueOf(Enum.java:238)
        at org.bukkit.ChatColor.valueOf(ChatColor.java:1)
        at com.scarsz.discordsrv.hooks.chat.VentureChatHook.broadcastMessageToChannel(VentureChatHook.java:57)
        at com.scarsz.discordsrv.DiscordSRV.broadcastMessageToMinecraftServer(DiscordSRV.java:692)
        at com.scarsz.discordsrv.listeners.DiscordListener.handleChat(DiscordListener.java:85)
        at com.scarsz.discordsrv.listeners.DiscordListener.onMessageReceived(DiscordListener.java:37)
        at com.scarsz.discordsrv.jda.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:184)
        at com.scarsz.discordsrv.jda.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:64)
        at com.scarsz.discordsrv.jda.handle.MessageReceivedHandler.handleDefaultMessage(MessageReceivedHandler.java:94)
        at com.scarsz.discordsrv.jda.handle.MessageReceivedHandler.handleInternally(MessageReceivedHandler.java:50)
        at com.scarsz.discordsrv.jda.handle.SocketHandler.handle(SocketHandler.java:38)
        at com.scarsz.discordsrv.jda.requests.WebSocketClient.handleEvent(WebSocketClient.java:596)
        at com.scarsz.discordsrv.jda.requests.WebSocketClient.onTextMessage(WebSocketClient.java:324)
        at com.neovisionaries.ws.client.ListenerManager.callOnTextMessage(ListenerManager.java:352)
        at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:233)
        at com.neovisionaries.ws.client.ReadingThread.callOnTextMessage(ReadingThread.java:211)
        at com.neovisionaries.ws.client.ReadingThread.handleTextFrame(ReadingThread.java:910)
        at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:693)
        at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:102)
        at com.neovisionaries.ws.client.ReadingThread.run(ReadingThread.java:61)
commented
commented

Needed a bit because I also tested if color like "light_purple" with underscore is also working but works → fixed, good job!