Skip to content

Commit fbf2730

Browse files
authored
Merge pull request #129 from lazybytez/feature/global-commands
Add possibility for global commands
2 parents 1a74815 + 4e2666d commit fbf2730

File tree

14 files changed

+283
-88
lines changed

14 files changed

+283
-88
lines changed

api/component_management.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func sortComponents() {
8888

8989
// IsComponentEnabled checks if a specific component is currently enabled
9090
// for a specific guild.
91+
// If the guild id is empty, the function will return the global status of the component.
9192
func IsComponentEnabled(comp *Component, guildId string) bool {
9293
if IsCoreComponent(comp) {
9394
return true
@@ -105,10 +106,9 @@ func IsComponentEnabled(comp *Component, guildId string) bool {
105106
}
106107

107108
if "" == guildId {
108-
comp.Logger().Warn("Missing guild with ID \"%v\" in database!", guildId)
109-
110-
return false
109+
return true
111110
}
111+
112112
guild, err := em.Guilds().Get(guildId)
113113
if nil != err {
114114
comp.Logger().Warn("Missing guild with ID \"%v\" in database!", comp.Name)

0 commit comments

Comments
 (0)