Fix issue with detecting a prefix when there is none
This commit is contained in:
parent
2668bb8cf5
commit
5160db8114
@ -63,14 +63,14 @@ func (c *CommandManager) OnMessage(session *discordgo.Session, m *discordgo.Mess
|
|||||||
|
|
||||||
prefixes := c.Prefixes(m.GuildID)
|
prefixes := c.Prefixes(m.GuildID)
|
||||||
var prefix string
|
var prefix string
|
||||||
|
var has bool
|
||||||
for _, prefix = range prefixes {
|
for _, prefix = range prefixes {
|
||||||
if strings.HasPrefix(content, prefix) {
|
if strings.HasPrefix(content, prefix) {
|
||||||
|
has = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Println(prefix)
|
if !has {
|
||||||
fmt.Println(prefixes)
|
|
||||||
if prefix == "" {
|
|
||||||
return // If we didn't find a valid prefix then exit
|
return // If we didn't find a valid prefix then exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user