fill README

This commit is contained in:
InsanusMokrassar committed 2022-07-09 21:09:13 +06:00
1 parent 0dcf9086c4
commit a2345fe496
3 files changed
+86 -7

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ class CommandsPlugin : Plugin {
runCatchingSafely {
commands ?.let {
setMyCommands(
commands,
commands.distinctBy { it.command },
key.scope,
key.languageCode
)
@@ -58,7 +58,7 @@ class CommandsPlugin : Plugin {
* take all the available keys in the [CommandsKeeper] and set commands for each key
*/
override suspend fun BehaviourContext.setupBotPlugin(koin: Koin) {
val commandsKeeper = koin.get<CommandsKeeper>()
val commandsKeeper = koin.commandsKeeper
log.d { "Subscribe to scopes changed flow" }
commandsKeeper.onScopeChanged.subscribeSafelyWithoutExceptions(scope) {
@@ -0,0 +1,10 @@
package dev.inmo.plagubot.plugins.commands
import org.koin.core.Koin
import org.koin.core.scope.Scope
val Scope.commandsKeeper
get() = get<CommandsKeeper>()
val Koin.commandsKeeper
get() = get<CommandsKeeper>()