Chatty icon indicating copy to clipboard operation
Chatty copied to clipboard

API

Open Vankka opened this issue 4 years ago • 5 comments

Hey, looking to hook Chatty into DiscordSRV, I'd need;

  • A way to figure out what channel a chat event went to (method or custom event)
  • A way to send messages to a specific channel

Vankka avatar Mar 30 '20 21:03 Vankka

Hello. I will make API classes as soon as possible)

Brikster avatar Mar 30 '20 22:03 Brikster

Hello! Sorry for a longtime pause.

I made API classes in dev. version. You can see them in repository now, check out "api" module. Version with API will be released soon.

Get access to API you can from "ru.mrbrikster.chatty.Chatty.class" instance: ((Chatty) Bukkit.getPlugin("Chatty")).api()

Brikster avatar Jul 17 '20 19:07 Brikster

The main class (ru.mrbrikster.chatty.Chatty.class) isn't available within the api module, you may want to have a interface for the api method and have the main class implement that, so something like;

((IChatty) Bukkit.getPluginManager().getPlugin("Chatty")).api()

could be used, right now the only way is to use reflection or include the main plugin source as well

Vankka avatar Sep 22 '20 14:09 Vankka

It seems that the API is giving no recipients, so messages being sent to Chats via the API are being sent to 0 players

Vankka avatar Jun 17 '21 17:06 Vankka

It gave no recipients with "single world" and local chats when using them with API. New version fixed this issue, now you can send messages to any chat that have any range value.

Brikster avatar Jul 17 '21 21:07 Brikster