Closed f1owkang closed 3 years ago
在实现定时任务时,需要主动发送消息如何构建Bot类型(java开发)
@Component
class A{
@Autowired
BotContainer botContainer;
public void sendMsg(){
long botId=123456789; // 需要指定使用哪个bot
Map<Long, Bot> botMap=botContainer().getBots();
Bot bot=botMap.get(botId);
if(bot==null){return;} // 如果机器人未连接,可能是null
bot.xxx()
}
}
非常感谢!
在实现定时任务时,需要主动发送消息如何构建Bot类型(java开发)