s/HasCommand/ContainsCommand/g
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
4a024e98f2
commit
579921a975
@ -38,7 +38,7 @@ func (h *CoinHandler) Handle(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !lib.HasCommand(m.Content, h.config.Prefix, h.Name) {
|
if !lib.ContainsCommand(m.Content, h.config.Prefix, h.Name) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ func (h *DealHandler) Handle(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !lib.HasCommand(m.Content, h.config.Prefix, h.Name) {
|
if !lib.ContainsCommand(m.Content, h.config.Prefix, h.Name) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ func (h *RollHandler) Handle(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !lib.HasCommand(m.Content, h.config.Prefix, h.Name) {
|
if !lib.ContainsCommand(m.Content, h.config.Prefix, h.Name) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ func (h *PingHandler) Handle(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !lib.HasCommand(m.Content, h.config.Prefix, h.Name) {
|
if !lib.ContainsCommand(m.Content, h.config.Prefix, h.Name) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ func (h *VersionHandler) Handle(s *discordgo.Session, m *discordgo.MessageCreate
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !lib.HasCommand(m.Content, h.config.Prefix, h.Name) {
|
if !lib.ContainsCommand(m.Content, h.config.Prefix, h.Name) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ func BuildURI(rawuri, rawpath string) string {
|
|||||||
return u.String()
|
return u.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func HasCommand(s, prefix, cmd string) bool {
|
func ContainsCommand(s, prefix, cmd string) bool {
|
||||||
s = strings.TrimSpace(s)
|
s = strings.TrimSpace(s)
|
||||||
|
|
||||||
args := strings.Split(s, " ")
|
args := strings.Split(s, " ")
|
||||||
|
@ -2,7 +2,7 @@ package lib
|
|||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestHasCommand(t *testing.T) {
|
func TestContainsCommand(t *testing.T) {
|
||||||
tables := []struct {
|
tables := []struct {
|
||||||
s string
|
s string
|
||||||
prefix string
|
prefix string
|
||||||
@ -18,9 +18,9 @@ func TestHasCommand(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, table := range tables {
|
for _, table := range tables {
|
||||||
r := HasCommand(table.s, table.prefix, table.cmd)
|
r := ContainsCommand(table.s, table.prefix, table.cmd)
|
||||||
if r != table.r {
|
if r != table.r {
|
||||||
t.Errorf("HasCommand(%q, %q, %q), got: %t, want: %t",
|
t.Errorf("ContainsCommand(%q, %q, %q), got: %t, want: %t",
|
||||||
table.s, table.prefix, table.cmd, r, table.r,
|
table.s, table.prefix, table.cmd, r, table.r,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user