首先,引入依赖;
Maven
<dependency>
    <groupId>io.github.ForteScarlet.simple-robot</groupId>
    <artifactId>component-cqhttp-spring-boot-starter</artifactId>
    <version>${version}</version>
</dependency>Gradle
implementation 'io.github.ForteScarlet.simple-robot:component-cqhttp-spring-boot-starter:${version}'
然后编写好配置类(与Springboot公用一个application.properties配置类)
配置编好后在启动类上使用@SimpleRobotSpringBootApplication代替@SpringbootApplication注解,并启动Springboot即可。
@SimpleRobotSpringBootApplication
public class TestApplication {
    public static void main(String[] args) {
        SpringApplication.run(Test1.class, args);
    }
}其中,@SimpleRobotSpringBootApplication是核心启动器所提供的,如果切换官方启动器,理论上不需要变更代码。
1.9.1之后,不再需要更替启动注解了。像往常一样即可。
@SpringBootApplication
public class RunApplication {
    public static void main(String[] args) {
        SpringApplication.run(RunApplication.class, args);
    }
}每一个组件启动器中一般来说都包含一个核心启动器。
正常情况下,你无需手动导入此坐标。
核心启动器的坐标为:
仓库地址:https://search.maven.org/artifact/io.github.ForteScarlet.simple-robot/core-spring-boot-starter
<dependency>
    <groupId>io.github.ForteScarlet.simple-robot</groupId>
    <artifactId>core-spring-boot-starter</artifactId>
    <version>${version}</version>
</dependency>但是,假如:组件启动器的版本为1.9.1,而前缀同为1.9的核心启动器的最新一个版本是1.9.2,那么你可以选择手动导入这个更新一个版本的核心来升级内部的核心启动器。
https://github.com/ForteScarlet/simple-robot-demo-cqhttp-sbstarter
https://github.com/ForteScarlet/simple-robot-core
https://github.com/ForteScarlet/simple-robot-component-coolHttpApi
https://github.com/ForteScarlet/simple-robot-core-springboot-starter
查看UPDATE.md文件