MiraiForum

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

    【已解决:使用close()】开发依赖core的程序,请问bot登陆后如何退出(结束线程)

    开发交流
    2
    4
    53
    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.
    • I
      imldy last edited by imldy

      需求是使用Quartz定时登录并通过程序发送消息,但是目前使用普通Main方法进行测试登录、发送消息之后似乎不会自动结束程序(或线程?),请问如何结束呢?
      在文档里面没找到。

      1 Reply Last reply Reply Quote 0
      • wssy001
        wssy001 ⭐2021⭐ last edited by

        可以使用bot.close(),但是需要重新new一个Bot才能实现重新登录。

        I 1 Reply Last reply Reply Quote 0
        • wssy001
          wssy001 ⭐2021⭐ last edited by

          或者直接 kill -9,简单粗暴。搞个定时任务重启程序

          1 Reply Last reply Reply Quote 0
          • I
            imldy @wssy001 last edited by

            @wssy001 感谢,这个应该是我需要的😄

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