Command parsing fixes
This commit is contained in:
parent
c9482d34de
commit
0279e6bd35
2 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ func (m *Module) OnUpdate(update tg.APIUpdate) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if utils.IsCommand(*update.Message, m.name, "metafora") {
|
if utils.IsCommand(*update.Message, m.name, "proverbio") {
|
||||||
start := rand.Intn(len(proverbipairs.start))
|
start := rand.Intn(len(proverbipairs.start))
|
||||||
end := rand.Intn(len(proverbipairs.end))
|
end := rand.Intn(len(proverbipairs.end))
|
||||||
m.client.SendTextMessage(tg.ClientTextMessageData{
|
m.client.SendTextMessage(tg.ClientTextMessageData{
|
||||||
|
|
|
@ -22,7 +22,7 @@ func IsCommand(update tg.APIMessage, botname string, cmdname string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check long form
|
// Check long form
|
||||||
if text == shortcmd || strings.HasPrefix(text, fullcmd+" ") {
|
if text == fullcmd || strings.HasPrefix(text, fullcmd+" ") {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue