Skip to content

Commit 2a8d380

Browse files
committed
Add CommandRegistry#clear
1 parent 73d491f commit 2a8d380

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/kotlin/me/devoxin/flight/api/entities/CommandRegistry.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ class CommandRegistry : HashMap<String, CommandFunction>() {
7171
}
7272
}
7373

74+
override fun clear() {
75+
val cogs = this.values.map(CommandFunction::cog)
76+
super.clear()
77+
doUnload(cogs)
78+
}
79+
7480
fun findCommandByName(name: String): CommandFunction? {
7581
return this[name]
7682
}

0 commit comments

Comments
 (0)