fix
This commit is contained in:
@@ -44,8 +44,13 @@ func (s *DuelController) StartMatch(c tele.Context) error {
|
|||||||
return c.Send(fmt.Sprintf("Дуэль уже началась!\nИгрок: %s\nСтавка: %d", s.PlayerOne.FName, s.Summ))
|
return c.Send(fmt.Sprintf("Дуэль уже началась!\nИгрок: %s\nСтавка: %d", s.PlayerOne.FName, s.Summ))
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Text() == "/duel" {
|
var text string
|
||||||
return c.Send("Используйте /duel <сумма> для начала дуэли!")
|
|
||||||
|
if strings.Contains(c.Text(), " ") {
|
||||||
|
text = strings.Split(c.Text(), " ")[1]
|
||||||
|
fmt.Println("new command", text)
|
||||||
|
} else {
|
||||||
|
return c.Send("Некоректная команда, используйте /duel <сумма>")
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Inited = true
|
s.Inited = true
|
||||||
@@ -54,8 +59,7 @@ func (s *DuelController) StartMatch(c tele.Context) error {
|
|||||||
|
|
||||||
user := s.DC.GetUser(s.PlayerOne.ID)
|
user := s.DC.GetUser(s.PlayerOne.ID)
|
||||||
|
|
||||||
a := strings.Split(c.Text(), "/duel ")[1]
|
summ, err := strconv.Atoi(text)
|
||||||
summ, err := strconv.Atoi(a)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.Send("Некорректная команда, используйте /duel <сумма>")
|
return c.Send("Некорректная команда, используйте /duel <сумма>")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user