kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
49 stars 22 forks source link

[Question] Is there a way to send messages to channels by adding a prefix? #1213

Closed CrispyDairy closed 3 years ago

CrispyDairy commented 3 years ago

Hey, is there any way to send a message to a certain channel by adding a prefix infront of it. For example, I want to be able to send messages to admin chat by writing this @{message text}. I know I can use /ch send admin, but thats very clumsy. i tried making an command alias, so /a would be /ch send admin. But I didn't get that to work.

ElBananaa commented 3 years ago

Hey! Yes this is possible, here's an example on how to do so. You need to put this in the rules/chat.rs file near the top (for me it's right under @import global

# -----------------------------------------------------------------------------------------------
# Forwarding messages to other channels.
# -----------------------------------------------------------------------------------------------

# Send messages starting with "$" to staffchat
match ^(\$)(.*)
require perm chatcontrol.channel.autojoin.staffchat.read
then command ch send staffchat $2
then deny
dont verbose
CrispyDairy commented 3 years ago

Alright thanks. I have another issue related to using a seperate partychat plugin with chatc. Should I make a seperate thing for it. Or can I send it here.

ElBananaa commented 3 years ago

Alright thanks. I have another issue related to using a seperate partychat plugin with chatc. Should I make a seperate thing for it. Or can I send it here.

You can post it here, however keep in mind that it's not recommended to use two plugin handling chat or stuff like that.

CrispyDairy commented 3 years ago

Is there a way to have a partychat using chatc? https://www.spigotmc.org/resources/partychat.79295/ Because the only issue with this is, that when people type in party chat, it also sends it to chatc chat. I can't figure out how chatc could tell that the messages are supposed to go to a different place.

CrispyDairy commented 3 years ago

I know I can do it with rules like the one above, but I have no idea where to start finding out how. I checked the wiki, and didn't find an answer.

ElBananaa commented 3 years ago

I'm not sure to understand what you'd like to do with the rules system, however, I'd suggest trying to play around with the listener priority in chatcontrol's settings file to see if it helps : https://github.com/kangarko/ChatControl-Red/wiki/Listener-Priorities (Make sure to restart the server after changing the priority since a plugin reload won't work)

CrispyDairy commented 3 years ago

I'll try that. Thanks!

kangarko commented 3 years ago

Thanks Banana for answering! Closing. Let me know below if you need any more help.