Show all pools on channels without api endpoint
This commit is contained in:
parent
48395717b1
commit
0d556e1ad7
11
commands.go
11
commands.go
|
@ -31,11 +31,22 @@ func isNickAllowed(nick string) error {
|
|||
}
|
||||
|
||||
func filterEntriesForChannel(bot *hbot.Bot, message *hbot.Message, entries []*channelEntry) (result []*channelEntry) {
|
||||
var actualEntry *channelEntry
|
||||
for _, e := range entries {
|
||||
if e.Channel == message.To {
|
||||
actualEntry = e
|
||||
}
|
||||
if e.ApiEndpoint != "" && (message.To == bot.Nick || e.Channel == message.To) {
|
||||
result = append(result, e)
|
||||
}
|
||||
}
|
||||
if len(result) == 0 && actualEntry != nil && actualEntry.ApiEndpoint == "" {
|
||||
for _, e := range entries {
|
||||
if e.ApiEndpoint != "" {
|
||||
result = append(result, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue