所以我目前正在使用一个IRC Bot,它使用run(String channel),然后启动一个Bot.class实例并将其添加到机器人列表中,因此同一个通道上的多个机器人将会出现。 所以我对如何在软件结束时结束这些实例感兴趣。我做了一些研究,但我只找到了如何结束线程/ runnables。那我怎么能这样做呢?
这是我的代码(有些位不相关):
ember build --environment=staging
...
public class MainBot {
static List<Bot> bots = new ArrayList<Bot>();
public static void main(String[] args) throws Exception {
run("ifnotbot");
}
...