Add ``extra`` object to SlashCommandContext
Closed this issue · 1 comments
Blad3Mak3r commented
Add an object that can be **Any and overwrited.
SlashCommandContext#setExtra(obj: Any)
SlashCommandContext#getExtra(): Any
This will permit:
fun SlashCommandContext.setConfig(config: GuildConfig) {
this.setExtra(config)
}
fun SlashCommandContext.getConfig(): GuildConfig {
val obj = this.getExtra() ?: error("GuildConfig has not been defined")
return obj as GuildConfig
}
Blad3Mak3r commented
Resolved on 253f8da