<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-depenent-content"data-active=""data-togglable=":dokkaHtml/main"><divclass="symbol monospace"><spanclass="token keyword">object </span><ahref="index.html">CommandsPlugin</a> : <spandata-unresolved-link="dev.inmo.plagubot/Plugin///PointingToDeclaration/">Plugin</span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">This plugin has been created for centralized work with commands in context of <spandata-unresolved-link="dev.inmo.plagubot/Plugin///PointingToDeclaration/">Plugin</span>s system of plagubot. Pass <ahref="../-bot-command-full-info/index.html">BotCommandFullInfo</a> in your <spandata-unresolved-link="dev.inmo.plagubot/Plugin/setupDI/org.koin.core.module.Module#org.jetbrains.exposed.sql.Database#kotlinx.serialization.json.JsonObject/PointingToDeclaration/">Plugin.setupDI</span> section to declare some command. You may use <ahref="../-commands-keeper/index.html">CommandsKeeper</a> for flexible setup of commands in runtime.</p></div></div>
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-depenent-content"data-active=""data-togglable=":dokkaHtml/main"><divclass="symbol monospace"><spanclass="token keyword">open </span><spanclass="token keyword">suspend override </span><spanclass="token keyword">fun </span><spandata-unresolved-link="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContext///PointingToDeclaration/">BehaviourContext</span><spanclass="token punctuation">.</span><ahref="setup-bot-plugin.html"><spanclass="token function">setupBotPlugin</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">koin<spanclass="token operator">: </span><spandata-unresolved-link="org.koin.core/Koin///PointingToDeclaration/">Koin</span></span></span><spanclass="token punctuation">)</span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><divclass="brief "><pclass="paragraph">Uses <ahref="../-commands-keeper/index.html">CommandsKeeper</a> from <ahref="setup-bot-plugin.html">koin</a>. Subscribe on <spandata-unresolved-link="dev.inmo.plagubot.plugins.commands/CommandsKeeper/scopesCommands/#/PointingToDeclaration/">CommandsKeeper.scopesCommands</span> to follow changed in scopes and take all the available keys in the <ahref="../-commands-keeper/index.html">CommandsKeeper</a> and set commands for each key</p></div><divclass="symbol monospace"><spanclass="token keyword">open </span><spanclass="token keyword">suspend </span><spanclass="token keyword">fun </span><spandata-unresolved-link="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContextWithFSM///PointingToDeclaration/">BehaviourContextWithFSM</span><spanclass="token operator"><</span><spanclass="token keyword"></span><spandata-unresolved-link="dev.inmo.micro_utils.fsm.common/State///PointingToDeclaration/">State</span><spanclass="token operator">></span><spanclass="token punctuation">.</span><ahref="index.html#-1448610639%2FFunctions%2F769193423"><spanclass="token function">setupBotPlugin</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">koin<spanclass="token operator">: </span><spandata-unresolved-link="org.koin.core/Koin///PointingToDeclaration/">Koin</span></span></span><spanclass="token punctuation">)</span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-depenent-content"data-active=""data-togglable=":dokkaHtml/main"><divclass="symbol monospace"><spanclass="token keyword">open </span><spanclass="token keyword">override </span><spanclass="token keyword">fun </span><spandata-unresolved-link="org.koin.core.module/Module///PointingToDeclaration/">Module</span><spanclass="token punctuation">.</span><ahref="setup-d-i.html"><spanclass="token function">setupDI</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">database<spanclass="token operator">: </span><spandata-unresolved-link="org.jetbrains.exposed.sql/Database///PointingToDeclaration/">Database</span><spanclass="token punctuation">, </span></span><spanclass="parameter ">params<spanclass="token operator">: </span><spandata-unresolved-link="kotlinx.serialization.json/JsonObject///PointingToDeclaration/">JsonObject</span></span></span><spanclass="token punctuation">)</span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><divclass="brief "><pclass="paragraph">Creating <ahref="../-commands-keeper/index.html">CommandsKeeper</a> and pass it to the DI. It uses <spandata-unresolved-link="org.koin.core.scope/Scope/getAll/#/PointingToDeclaration/">org.koin.core.scope.Scope.getAll</span> to get all the <ahref="../-bot-command-full-info/index.html">BotCommandFullInfo</a> instances declared in the DI.</p></div></div></div>