Interface ExtendedMessageSerializerService

  • All Implemented Interfaces:
    net.mamoe.mirai.spi.BaseService

    
    public interface ExtendedMessageSerializerService
     implements BaseService
                        

    额外的消息序列化器,用于处理不同 Onebot 平台的特殊情况

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Message deserialize(RemoteBot bot, String type, JsonObject data) 反序列化 Onebot 消息段为 Mirai 消息 CQ 码会先转为消息段再进行处理,无需担心CQ码兼容问题
      abstract Pair<String, JsonObject> serialize(RemoteBot bot, Message message) 序列化 Mirai 消息为 Onebot 消息段
      • Methods inherited from class net.mamoe.mirai.spi.BaseService

        getPriority
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • deserialize

         abstract Message deserialize(RemoteBot bot, String type, JsonObject data)

        反序列化 Onebot 消息段为 Mirai 消息 CQ 码会先转为消息段再进行处理,无需担心CQ码兼容问题

        Parameters:
        bot - 机器人实例
        type - 消息类型
        data - 消息数据
      • serialize

         abstract Pair<String, JsonObject> serialize(RemoteBot bot, Message message)

        序列化 Mirai 消息为 Onebot 消息段

        Parameters:
        bot - 机器人实例
        message - Mirai 消息