Interface RemoteBot

  • All Implemented Interfaces:

    
    public interface RemoteBot
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class RemoteBot.Companion
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • executeAction

         abstract String executeAction(ActionContext context, String params)

        执行自定义动作

        详见 Onebot 11 公开 APIgo-cqhttp 公开 API

        用例:

        // kotlin
        val result = onebot.executeAction(
            context = ActionContext.build("get_guild_list") {
                throwExceptions(true)
            },
            params = null
        )
        // java
        String result = onebot.executeAction(
            ActionContext.build("get_guild_list", builder -> {
                builder.throwExceptions(true);
            }),
            null
        );
        Parameters:
        context - 自定义请求上下文,可控制抛出异常、忽略标准格式等选项
        params - 请求参数,可为空
      • getMsg

         abstract MessageChain getMsg(Integer messageId)

        通过消息id获取消息,并反序列化为 mirai 格式消息

        Parameters:
        messageId - 消息id
      • getNoPlatform

         abstract Boolean getNoPlatform()

        配置中是否已禁止 Overflow 调用网络接口