日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

JAVA——使用Spring Boot Scheduled时注入simple-robot Bot解决方案

發布時間:2024/10/5 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 JAVA——使用Spring Boot Scheduled时注入simple-robot Bot解决方案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Maven?

<dependency><groupId>love.forte.simple-robot</groupId><artifactId>component-mirai-spring-boot-starter</artifactId><version>1.16.0-preview.3</version></dependency>

官方文檔?

simple-robot 2.0 bot開發文檔

simple-robot 機器人開發者使用文檔

解決方案?

package cn.edu.zstu.myzstu.robot.qq.quartz;import cn.edu.zstu.myzstu.robot.qq.service.IHealthDeclarationService; import com.forte.qqrobot.bot.BotManager; import com.forte.qqrobot.sender.MsgSender; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component;/*** @Author ShenTuZhiGang* @Version 1.0.0* @Date 2020-07-12 21:18*/ @Component public class HealthDeclarationWarm{@Autowiredprivate BotManager botManager;//@Override@Scheduled(cron = "0 0 8,9,10,11 * * *")public void execute() {MsgSender sender = botManager.getBot("314").getSender();} }

參考文章

simple-robot 2.0 bot開發文檔

simple-robot 機器人開發者使用文檔

總結

以上是生活随笔為你收集整理的JAVA——使用Spring Boot Scheduled时注入simple-robot Bot解决方案的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。