diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt b/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt index 02467d6..ee6ad12 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/Mobibot.kt @@ -401,6 +401,7 @@ class Mobibot(nickname: String, val channel: String, logsDirPath: String, p: Pro addons.add(Ignore()) addons.add(LinksMgr()) addons.add(Me()) + addons.add(Modules(addons)) addons.add(Msg()) addons.add(Nick()) addons.add(Posting()) @@ -426,7 +427,6 @@ class Mobibot(nickname: String, val channel: String, logsDirPath: String, p: Pro addons.add(Info(tell)) addons.add(Joke()) addons.add(Lookup()) - addons.add(Modules(addons.modulesNames)) addons.add(Ping()) addons.add(RockPaperScissors()) addons.add(StockQuote()) diff --git a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt index 9ed298c..1ded9ba 100644 --- a/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt +++ b/src/main/kotlin/net/thauvin/erik/mobibot/commands/Modules.kt @@ -32,12 +32,13 @@ package net.thauvin.erik.mobibot.commands +import net.thauvin.erik.mobibot.Addons import net.thauvin.erik.mobibot.Utils.helpFormat import net.thauvin.erik.mobibot.Utils.isChannelOp import net.thauvin.erik.mobibot.Utils.sendList import org.pircbotx.hooks.types.GenericMessageEvent -class Modules(private val modulesNames: List) : AbstractCommand() { +class Modules(private val addons: Addons) : AbstractCommand() { override val name = "modules" override val help = listOf("To view a list of enabled modules:", helpFormat("%c $name")) override val isOpOnly = true @@ -46,11 +47,11 @@ class Modules(private val modulesNames: List) : AbstractCommand() { override fun commandResponse(channel: String, args: String, event: GenericMessageEvent) { if (isChannelOp(channel, event)) { - if (modulesNames.isEmpty()) { + if (addons.modulesNames.isEmpty()) { event.respondPrivateMessage("There are no enabled modules.") } else { event.respondPrivateMessage("The enabled modules are: ") - event.sendList(modulesNames, 7, isIndent = true) + event.sendList(addons.modulesNames, 7, isIndent = true) } } else { helpResponse(channel, args, event)