Skip to content

update 1.0.13

Compare
Choose a tag to compare
@mastercake10 mastercake10 released this 20 May 12:42
· 49 commits to master since this release
  • added the class Cancellable that allows developers to cancel the two implemented API methods shown below.

Example usage:

import de.Linus122.TelegramChat.TelegramActionListener;
import de.Linus122.TelegramComponents.Chat;
import de.Linus122.TelegramComponents.ChatMessageToMc;

public class TelegramListener implements TelegramActionListener {

    @Override
    public void onSendToMinecraft(ChatMessageToMc msg) {
        if (msg.text.contains("swearword")) {
             msg.setCancelled();
        }
    }

    @Override
    public void onSendToTelegram(ChatMessageToTelegram msg) {
        if (msg.content.contains("swearword")) {
             msg.setCancelled();
        }   
    }

}