Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

API? #17

Closed
JamieSinn opened this issue Mar 27, 2016 · 8 comments
Closed

API? #17

JamieSinn opened this issue Mar 27, 2016 · 8 comments

Comments

@JamieSinn
Copy link

Is there an API available?
I'd need to hook in and send messages as well as set prefixes etc.

See Herochat's api for an example of what I need.

@kangarko
Copy link
Owner

There's no API at the moment.
What exactly do you need. Please give me examples of implementation and I will consider adding it.

** Sun, 27 Mar 2016 09:29:24 -0700 - "kangarko/ChatControl-Pro" chatcontrol-pro@noreply.github.com, "kangarko/ChatControl-Pro" reply@reply.github.com **

Is there an API available?
I'd need to hook in and send messages as well as set prefixes etc.

See Herochat's api for an example of what I need.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#17

@JamieSinn
Copy link
Author


You can find out information about channel-based messages by listening for a ChannelChatEvent. This custom event contains the message sender (a Chatter object), the channel the message is being sent to, the result of the messaging attempt (a Chatter.Result object), and the original Bukkit PlayerChatEvent that resulted in the ChannelChatEvent. If you change the channel the message is being sent to, you should call event.setResult(event.getSender().canSpeak(newChannel)) unless you want to ignore the normal checks before sending the message.

From herochat's bukkit dev page.

Specifically, I need the following

  • A way to get a channel's messages, and edit them or resend to another channel.
  • A way to send a message to a channel.
  • A way to have tag formatting that can be replaced when a player chats.

@JamieSinn
Copy link
Author

If this is too much, is it possible to just use the chat filtering part without using the chat channels and the related parts?

@kangarko
Copy link
Owner

kangarko commented Apr 15, 2016

It's not too much :) Seems like I can implement a ChannelChatEvent, to which you can listen and act accordingly.

  • Sending a message to a channel will be implemented from the console. Then, you will be able to manually execute a console command without the need of an API.
  • I don't understand, what do you mean? You are able to catch AsyncPlayerChatEvent on a higher priority, after ChatControl, and furthermore edit the message to your likings.

But currently I have a very busy time, totally lack of any space for development honestly :/

@JamieSinn
Copy link
Author

Ah, that sounds good, no ETA needed.

In regards to the question later on: Is it possible to use the chat filtering for curse words part of this plugin without using the chat channels and the rest of this plugin.

@kangarko
Copy link
Owner

Yes, you can turn off any part of the plugin except for rules, which also work with chat formatter disabled.

@kangarko kangarko mentioned this issue May 8, 2016
14 tasks
@kangarko kangarko closed this as completed May 8, 2016
@kangarko
Copy link
Owner

@JamieSinn hello! I am sorry for the delay :(

Here is the API I currently implemented:

me.kangarko.chatcontrol.api.ChannelAPI for manipulating with channels.
The event 'ChatChannelEvent' allows you to modify the message, format, recipients, or get information regarding the channel or even cancel the message before it's sent out.

I think it will be sufficient for you. The release is scheduled this week. Let me know if you have any inquiries.

@JamieSinn
Copy link
Author

Thanks! That should be great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants