diff --git a/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Gentleman.kt b/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Gentleman.kt index 9d3872391..beac566f5 100644 --- a/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Gentleman.kt +++ b/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Gentleman.kt @@ -18,7 +18,7 @@ private const val IMAGE_BUFFER_CAPACITY: Int = 5 @ExperimentalUnsignedTypes @ExperimentalCoroutinesApi object Gentlemen : MutableMap by mutableMapOf() { - fun getOrPut(key: Contact): Gentleman = this.getOrPut(key.id) { Gentleman(key) } + fun provide(key: Contact): Gentleman = this.getOrPut(key.id) { Gentleman(key) } } /** diff --git a/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt b/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt index 226340b67..69d94c2e6 100644 --- a/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt +++ b/mirai-demos/mirai-demo-gentleman/src/main/kotlin/demo/gentleman/Main.kt @@ -43,7 +43,7 @@ suspend fun main() { try { repeat(it.toIntOrNull() ?: 1) { launch { - Gentlemen.getOrPut(subject).receive().image.await().send() + Gentlemen.provide(subject).receive().image.await().send() } } } catch (e: Exception) {