Mirai-Http-Api-JavaSDK
-
此项目基于mirai-http-api
请启用ws功能开源地址:https://github.com/xbaimiao/mirai-http-sdk
fun main() { val wsInfo = WsInfo("http://127.0.0.1:8099/", 2157207381, "INITKEYCgTu5Bcx") bot = WebSocketBot(wsInfo).connect() bot.join() bot.eventChancel.subscribe<GroupMessageEvent> { val msg = message.contentToString() var boolean1 = false for (baseComponent in this.message.toList()) { if (baseComponent is PlainText) { if (baseComponent.string == "禁言") { boolean1 = true } } } for (baseComponent in this.message.toList()) { if (baseComponent is At) { if (boolean1) { group.getMember(baseComponent.target).thenAccept { it!!.mute(600) } } } } if (msg == "回复我") { group.quoteMessage(Component.text("好"), "${this.messageSource.messageId}") } } }
-
通过kotlin使用http api调用…kotlin
-
@tsudzuki
有没有一种可能我机器人和需要使用机器人的项目不在同一个地方