Handle NOTICEs in isFromChannel and isFromUser (#21)

This commit is contained in:
nmeum 2018-11-02 17:24:38 +01:00 committed by Liam Stanley
parent 5a5805298c
commit 3a1cc735c7

@ -472,7 +472,7 @@ func (e *Event) IsCTCP() (ok bool, ctcp *CTCPEvent) {
// IsFromChannel checks to see if a message was from a channel (rather than
// a private message).
func (e *Event) IsFromChannel() bool {
if e.Source == nil || e.Command != PRIVMSG || len(e.Params) < 1 {
if e.Source == nil || (e.Command != PRIVMSG && e.Command != NOTICE) || len(e.Params) < 1 {
return false
}
@ -486,7 +486,7 @@ func (e *Event) IsFromChannel() bool {
// IsFromUser checks to see if a message was from a user (rather than a
// channel).
func (e *Event) IsFromUser() bool {
if e.Source == nil || e.Command != PRIVMSG || len(e.Params) < 1 {
if e.Source == nil || (e.Command != PRIVMSG && e.Command != NOTICE) || len(e.Params) < 1 {
return false
}