mirror of
https://github.com/InsanusMokrassar/PlaguBotCommandsPlugin.git
synced 2026-11-02 17:33:08 +00:00
fill README
This commit is contained in:
1 parent
0dcf9086c4
commit
a2345fe496
3 files changed
+86
-7
No files matched your search
@@ -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>()
|
||||
Reference in new issue
Block a user