s/HasCommand/ContainsCommand/g
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Ryan Cavicchioni 2022-09-05 12:54:56 -05:00
parent 4a024e98f2
commit 579921a975
Signed by: ryanc
GPG Key ID: 877EEDAF9245103D
7 changed files with 9 additions and 9 deletions

View File

@ -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
} }

View File

@ -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
} }

View File

@ -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
} }

View File

@ -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
} }

View File

@ -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
} }

View File

@ -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, " ")

View File

@ -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,
) )
} }