Commit b10e0104 authored by Him188moe's avatar Him188moe

Kotlin coroutine

parent ef08b044
...@@ -18,9 +18,6 @@ import java.util.concurrent.CompletableFuture ...@@ -18,9 +18,6 @@ import java.util.concurrent.CompletableFuture
* @author Him188moe * @author Him188moe
*/ */
abstract class Contact internal constructor(val bot: Bot, val number: Long) { abstract class Contact internal constructor(val bot: Bot, val number: Long) {
/**
* Async
*/
abstract suspend fun sendMessage(message: MessageChain) abstract suspend fun sendMessage(message: MessageChain)
/** /**
...@@ -44,5 +41,5 @@ abstract class Contact internal constructor(val bot: Bot, val number: Long) { ...@@ -44,5 +41,5 @@ abstract class Contact internal constructor(val bot: Bot, val number: Long) {
/** /**
* Async * Async
*/ */
abstract fun sendXMLMessage(message: String) abstract suspend fun sendXMLMessage(message: String)
} }
...@@ -29,7 +29,7 @@ class Group(bot: Bot, number: Long) : Contact(bot, number), Closeable { ...@@ -29,7 +29,7 @@ class Group(bot: Bot, number: Long) : Contact(bot, number), Closeable {
bot.network.message.sendGroupMessage(this, message) bot.network.message.sendGroupMessage(this, message)
} }
override fun sendXMLMessage(message: String) { override suspend fun sendXMLMessage(message: String) {
} }
......
...@@ -22,7 +22,7 @@ class QQ(bot: Bot, number: Long) : Contact(bot, number) { ...@@ -22,7 +22,7 @@ class QQ(bot: Bot, number: Long) : Contact(bot, number) {
bot.network.message.sendFriendMessage(this, message) bot.network.message.sendFriendMessage(this, message)
} }
override fun sendXMLMessage(message: String) { override suspend fun sendXMLMessage(message: String) {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment