BotMine›Developer Docs›Config
Lua Addon SDK
Config
Lies Addon-Konfigurationen und Schema-Informationen aus.
Überblick
Die Konfiguration ist über config und discord.config erreichbar. Sie enthält Werte, die für eine Bot-Installation gesetzt wurden.
lualocal logChannelId = config:get("log_channel") local requiredValue = config:require("api_key") if config:has("enabled") then logger.info("Addon ist konfiguriert.") end
Methoden
get(key, fallback?)require(key)has(key)all()schema()
Fallbacks
lualocal prefix = config:get("prefix", "!")
Schema lesen
lualocal schema = config:schema() for index = 1, #schema do logger.debug(schema[index].key) end