Skip to content

Commit

Permalink
Merge pull request #129 from lazybytez/feature/global-commands
Browse files Browse the repository at this point in the history
Add possibility for global commands
  • Loading branch information
elias-knodel authored Jan 18, 2023
2 parents 1a74815 + 4e2666d commit fbf2730
Show file tree
Hide file tree
Showing 14 changed files with 283 additions and 88 deletions.
6 changes: 3 additions & 3 deletions api/component_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func sortComponents() {

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

if "" == guildId {
comp.Logger().Warn("Missing guild with ID \"%v\" in database!", guildId)

return false
return true
}

guild, err := em.Guilds().Get(guildId)
if nil != err {
comp.Logger().Warn("Missing guild with ID \"%v\" in database!", comp.Name)
Expand Down
Loading

0 comments on commit fbf2730

Please sign in to comment.