小白提问 #125
Answered
by
ForteScarlet
Huang-xiaoyi
asked this question in
Q&A
小白提问
#125
-
涉及的编程语言Java 涉及的组件库mirai (QQ) 疑问描述我是一名刚接触springboot的小白,最近结合文档,跟着文档里的教学视频敲了代码,却发现properties文件里的内容怎么改都不能像教学视频里面前半段那样正确地获得QQ回应,求各位大佬指点。 这是配置文件 bot.properties component=simbot.mirai
code=账号
passwordInfo.type=text
passwordInfo.value.text=密码
simbot.auto-start-bots=true
# 自定义配置bot资源文件的扫描路径。
# 默认为 classpath:simbot-bots/*.bot*
simbot.bot-configuration-resources[0]=classpath:simbot-bots/*.bot*
# 如果需要,此处配置扫描顶层函数形式的监听函数。
# 默认不扫描
# simbot.top-level-listener-scan-package[0]=example.listener.foo
# simbot.top-level-listener-scan-package[1]=example.listener.bar
# 如果需要,此处配置扫描顶层函数形式的 Binder Factory。
# 默认不扫描
# simbot.top-level-binder-scan-package[0]=example.binder.foo
# simbot.top-level-binder-scan-package[1]=example.binder.bar 这是启动类 Main.java @EnableSimbot //
@SpringBootApplication
public class Main {
public static void main(String[] args) {
SpringApplication.run(Main.class, args);
}
} 运行完了以后的日志信息 2023-04-20T10:58:01.527+08:00 INFO 12960 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.1]
2023-04-20T10:58:01.595+08:00 INFO 12960 --- [ main] simbot-maven-java-spring-boot-archetype] : Initializing Spring embedded WebApplicationContext
2023-04-20T10:58:01.596+08:00 INFO 12960 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1369 ms
2023-04-20T10:58:01.703+08:00 INFO 12960 --- [ main] love.forte.simbot.utils.BlockingRunner : Blocking runner wait timeout is enabled with wait timeout 1m. You can enable debug logging for 'love.forte.simbot.utils.BlockingRunner' for more stack information or disable it with the JVM parameter '-Dsimbot.blockingRunner.disableWaitTimeout=true'.
2023-04-20T10:58:01.718+08:00 INFO 12960 --- [ main] ngBootComponentAutoInstallBuildConfigure : The number of Installable Event Provider Factories is 0
2023-04-20T10:58:01.720+08:00 INFO 12960 --- [ main] ngBootComponentAutoInstallBuildConfigure : Install components by [installAllComponents] via classLoader jdk.internal.loader.ClassLoaders$AppClassLoader@63947c6b
2023-04-20T10:58:01.720+08:00 INFO 12960 --- [ main] otEventProviderAutoInstallBuildConfigure : The number of Installable event provider Factories is 0
2023-04-20T10:58:01.720+08:00 INFO 12960 --- [ main] otEventProviderAutoInstallBuildConfigure : Install event providers by [installAllEventProviders] via classLoader jdk.internal.loader.ClassLoaders$AppClassLoader@63947c6b
2023-04-20T10:58:01.742+08:00 INFO 12960 --- [ main] s.a.a.SpringBootApplicationConfiguration : The size of providers built is 0
2023-04-20T10:58:01.746+08:00 INFO 12960 --- [ main] s.a.a.SpringBootApplicationConfiguration : Bots all registered. The size of bots: 0
2023-04-20T10:58:01.747+08:00 INFO 12960 --- [ main] s.a.a.SpringBootApplicationConfiguration : Simbot Spring Boot Application built in 29.745100ms
2023-04-20T10:58:01.857+08:00 WARN 12960 --- [ main] .s.b.StandardBotVerifyInfoDecoderFactory : Unable to find the com.charleskorn.kaml:kaml in current classpath, the bot configuration parser in *.bot.yaml format will not be available.
2023-04-20T10:58:01.857+08:00 WARN 12960 --- [ main] .s.b.StandardBotVerifyInfoDecoderFactory : Unable to find the kotlinx-serialization-properties in current classpath, the bot configuration parser in *.bot.properties format will not be available.
2023-04-20T10:58:02.074+08:00 INFO 12960 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '/simbot-maven-java-spring-boot-archetype'
2023-04-20T10:58:02.084+08:00 INFO 12960 --- [ main] org.example.Main : Started Main in 2.199 seconds (process running for 2.457) |
Beta Was this translation helpful? Give feedback.
Answered by
ForteScarlet
Apr 20, 2023
Replies: 1 comment
-
有关bot的配置信息并不应在 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Huang-xiaoyi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
有关bot的配置信息并不应在
application.properties
中,而是在resources/simbot-bots/
目录下。既然看过视频,视频 09:13 处可以看到左侧文件目录结构,那里有
resources/simbot-bots/demo.bot.json
文件,那才是应该配置bot账号信息的地方。