1
1
package com.hrs.Kloping.Kotlin
2
2
3
- import com.hrs.Kloping.Kotlin.ListenerHosts.BaseMessageListener
4
- import com.hrs.Kloping.Kotlin.Plugins.PluginLoader
5
3
import com.hrs.MySpringTool.Starter
6
4
import com.hrs.MySpringTool.Starter.AllAfterOrBefore
5
+ import com.hrs.MySpringTool.annotations.AutoStand
7
6
import com.hrs.MySpringTool.annotations.CommentScan
8
7
import com.hrs.MySpringTool.exceptions.NoRunException
9
8
import kotlinx.coroutines.runBlocking
@@ -22,11 +21,18 @@ import java.util.concurrent.Executors
22
21
23
22
@CommentScan(path = " com.hrs.Kloping.Kotlin" )
24
23
object BotStarter {
25
- const val qq = 0L
26
- const val password = " "
24
+
25
+ @AutoStand(id = " qq" )
26
+ var qq = 0L
27
+
28
+ @AutoStand(id = " pwd" )
29
+ var password = " "
27
30
28
31
@JvmStatic
29
32
fun main (args : Array <String >) {
33
+ // 启动 工具处理
34
+ startSpring()
35
+ // 创建配置
30
36
val botConfiguration = BotConfiguration ()
31
37
// 登录协议
32
38
botConfiguration.protocol = MiraiProtocol .ANDROID_PHONE
@@ -38,23 +44,22 @@ object BotStarter {
38
44
botConfiguration.fileBasedDeviceInfo(" ./device.json" )
39
45
// 创建 Bot
40
46
val bot = newBot(qq, password, botConfiguration)
47
+ // 登录
41
48
runBlocking {
42
- // 登录
43
49
bot.login()
44
50
}
45
51
// 注册消息处理 通道
46
- bot.eventChannel.registerListenerHost(BaseMessageListener ())
47
- // 启动 工具处理
48
- startSpring()
52
+ bot.eventChannel.registerListenerHost(com.hrs.Kloping .java.ListenerHosts .BaseMessageListener ())
49
53
// 加载插件
50
- PluginLoader .load(args)
54
+ com.hrs. Kloping .java. Plugins . PluginLoader .load(args)
51
55
}
52
56
53
57
val threads = Executors .newFixedThreadPool(20 )
54
58
55
59
// 这里是关键点 不懂得话可以去看我的另一个github
56
60
// https://github.com/Kloping/my-spring-tool
57
61
private fun startSpring () {
62
+ Starter .loadConfigurationFile(" ./conf.properties" )
58
63
Starter .run (BotStarter ::class .java)
59
64
Starter .setLog_Level(1 )
60
65
Starter .set_key(Class .forName(" java.lang.Long" ))
0 commit comments