Simple Robot v4.15.0 Help

使用 Spring Boot 2

安装

  1. 准备Java

    我们推荐您使用 Spring Boot 3.x。因此 Java 的版本至少为 Java17

  2. 准备 Spring Boot 项目

    前往 start.spring.io 选择、创建一个 Spring Boot 项目下载。 当然,你也可以选择其他任意可行方式来创建项目,例如借助IDE。

    更多参考:

  3. 添加 simbot starter 依赖

    使用 Spring Boot 3,确保项目的JDK版本大于等于 JDK17。

    implementation("love.forte.simbot:simbot-core-spring-boot-starter:4.15.0")
    implementation 'love.forte.simbot:simbot-core-spring-boot-starter:4.15.0'
    <dependency> <groupId>love.forte.simbot</groupId> <artifactId>simbot-core-spring-boot-starter</artifactId> <version>4.15.0</version> </dependency>
    implementation("love.forte.simbot:simbot-core-spring-boot-starter-v2:4.15.0")
    implementation 'love.forte.simbot:simbot-core-spring-boot-starter-v2:4.15.0'
    <dependency> <groupId>love.forte.simbot</groupId> <artifactId>simbot-core-spring-boot-starter-v2</artifactId> <version>4.15.0</version> </dependency>
  4. 添加组件及其要求的其他内容

    simbot的组件是功能的主要提供者,是重要的核心概念之一。 你可以前往 组件库 选择你所需要的组件并添加它们,而它们的手册通常都会有各自相应的快速开始安装章节。

    你也可以使用任何可用的第三方组件,并参照它们各自的文档说明进行安装。

与 Spring Boot 3 的主要差异

  • 依赖坐标为 love.forte.simbot:simbot-core-spring-boot-starter-v2

  • @EnableSimbot 位于 love.forte.simbot.spring2

  • 相关配置、处理器与应用实现主要位于 love.forte.simbot.spring2.*

  • Java 基线为 11,而不是 17

使用

启用 simbot

import love.forte.simbot.spring2.EnableSimbot @EnableSimbot @SpringBootApplication class MyApplication fun main(args: Array<String>) { runApplication<MyApplication>(*args) }
import love.forte.simbot.spring2.EnableSimbot; @EnableSimbot @SpringBootApplication public class MyApplication { public static void main(String[] args) { SpringApplication.run(MyApplication.class, args); } }

编写事件处理器

前往 编写事件处理器 了解更多。

安装组件以及组件配置

前往 安装组件以及组件配置 了解更多。

注册Bot

前往 注册 Bot 了解更多。

运行或打包

前往 运行或打包 了解更多。

26 June 2026