Overlord is an Actor that is not binded to specific conversation. Currently overlords is responsible to receiving web hooks.
For implementing overlord, you need to subclass MagicOverlord class and implement required methods:
class ExampleOverlord(scope: MagicOverlordScope) : MagicOverlord(scope) {
override fun onRawWebHookReceived(name: String, body: ByteArray, headers: JSONObject) {
// Implement Hook Processing
}
}
Also you need to register overlord class:
farm("BotFarm") {
bot(EchoBot::class) {
name = "echo"
token = "<YOUR_TOKEN_HERE>"
traceHook = "<OPTIONAL_TRACE_WEBHOOK>"
overlord = ExampleOverlord::class
}
}
This message can be received in onReceive
method of overlord. WARRING: Do not forget to call super class method.
fun sendToOverlord(object: Any)