MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    使用mcl登录如何获取Bot对象?

    开发交流
    5
    5
    246
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Kided
      Kided last edited by

      萌新。
      主动向好友发送消息需要bot.getFriend(),而bot需要用BotFactory.INSTANCE.newBot()创建。当我使用mcl登录时,mcl接管了我的登录过程,我该怎么获取bot来主动发送消息呢?

      1 Reply Last reply Reply Quote 0
      • Nambers
        Nambers 摸鱼 last edited by Nambers

        在插件里,每个事件都有this.bot(应该), 用这个取bot实例然后getFriend

        1 Reply Last reply Reply Quote 0
        • RainChan
          RainChan 摸鱼 last edited by

          参考Bot类

          1 Reply Last reply Reply Quote 0
          • ryoii
            ryoii 梦中的鸡翅 last edited by

            Bot.getInstance(qq: Long)
            
            1 Reply Last reply Reply Quote 1
            • S
              StarGods last edited by

              GlobalEventChannel.subscribeAlways<BotOnlineEvent> { event ->
              val groups = event.bot.groups
              }

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact