Optional interfaces
Beyond Module, Goroku checks for these at registration. Implement the method and the capability turns on; skip it and nothing happens.
Assert them at compile time
An optional interface is matched by shape. A typo in the signature means your method is silently ignored. One line prevents that:
var _ goroku.ModuleWithConfigSchema = (*Weather)(nil)ModuleWithMeta
CommandMetas() map[string]CommandMetaAliases and filters per command. See CommandMeta.
ModuleWithWatcherMetas
WatcherMetas() []CommandMetaFilters for watchers, matched positionally to Watchers().
ModuleWithConfigSchema
ConfigSchema() []ConfigFieldTyped settings with defaults and validation. The preferred config surface. See ConfigField.
ModuleWithConfigReady
ConfigReady(config map[string]any) errorCalled at startup and whenever a setting changes. Returning an error rejects the change.
ModuleWithConfig
ConfigDefaults() map[string]anyOlder, untyped config surface. Prefer ConfigSchema.
ModuleWithConfigValidators
ConfigValidators() map[string]ValidatorValidators for ConfigDefaults. Unnecessary with ConfigSchema, which carries its own.
ModuleWithTranslationAliases
TranslationAliases() []stringExtra names to try when resolving translation keys, for modules whose translation files use a name that does not derive from Name().
func (m *APIProtection) Name() string { return "APILimiter" }
func (m *APIProtection) TranslationAliases() []string {
return []string{"api_protection"}
}ModuleWithAllModules
SetAllModules(*Modules)Receives the module registry, for modules that inspect or drive other modules — help, config UI, loaders.
ModuleWithTranslator
SetTranslator(*Translator)Receives a translator. Unnecessary when embedding Base, which already has one.
SecuredModule
CommandPermissions() map[string]intDefault permission masks per command. See Permissions.
RatelimitedModule
RatelimitedCommands() map[string]boolCommands subject to rate limiting. Equivalent to Ratelimit: true in CommandMeta.