Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Latest commit

 

History

History
26 lines (18 loc) · 1017 Bytes

bot-messages.md

File metadata and controls

26 lines (18 loc) · 1017 Bytes

Message Types

Bot Platform have several message types: text, document (with photo, video, audio extensions), service messages and abstract JSON-message.

public abstract class MagicBotMessage(val peer: BotMessages.OutPeer, val sender: BotMessages.UserOutPeer,
                                      val rid: Long) {

}

public class MagicBotTextMessage(peer: BotMessages.OutPeer, sender: BotMessages.UserOutPeer, rid: Long,
                                 val text: String) : MagicBotMessage(peer, sender, rid) {
    var command: String? = null
    var commandArgs: String? = null
}

public class MagicBotJsonMessage(peer: BotMessages.OutPeer, sender: BotMessages.UserOutPeer, rid: Long,
                                 val json: JSONObject) : MagicBotMessage(peer, sender, rid) {

}

public class MagicBotDocMessage(peer: BotMessages.OutPeer, sender: BotMessages.UserOutPeer, rid: Long,
                                val doc: BotMessages.DocumentMessage) : MagicBotMessage(peer, sender, rid) {

}