mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
Fix: Move disable check to other disable checks
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
1b1c5daebf
commit
56e138724b
1 changed files with 4 additions and 5 deletions
|
@ -46,6 +46,10 @@ func (a *autoMessage) CanSend() bool {
|
|||
}
|
||||
|
||||
switch {
|
||||
case !str.StringInSlice(a.Channel, config.Channels):
|
||||
// Not an observed channel, auto-message is not valid
|
||||
return false
|
||||
|
||||
case a.MessageInterval > a.linesSinceLastMessage:
|
||||
// Not enough chatted lines
|
||||
return false
|
||||
|
@ -116,11 +120,6 @@ func (a *autoMessage) ID() string {
|
|||
}
|
||||
|
||||
func (a *autoMessage) IsValid() bool {
|
||||
if !str.StringInSlice(a.Channel, config.Channels) {
|
||||
// Not an observed channel, auto-message is not valid
|
||||
return false
|
||||
}
|
||||
|
||||
if a.Cron != "" {
|
||||
if _, err := cronParser.Parse(a.Cron); err != nil {
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue