This commit is contained in:
SmileRex
2025-01-23 19:06:56 +03:00
parent e852cdf58f
commit 9dd043c32c

View File

@@ -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))
}
if c.Text() == "/duel" {
return c.Send("Используйте /duel <сумма> для начала дуэли!")
var text string
if strings.Contains(c.Text(), " ") {
text = strings.Split(c.Text(), " ")[1]
fmt.Println("new command", text)
} else {
return c.Send("Некоректная команда, используйте /duel <сумма>")
}
s.Inited = true
@@ -54,8 +59,7 @@ func (s *DuelController) StartMatch(c tele.Context) error {
user := s.DC.GetUser(s.PlayerOne.ID)
a := strings.Split(c.Text(), "/duel ")[1]
summ, err := strconv.Atoi(a)
summ, err := strconv.Atoi(text)
if err != nil {
return c.Send("Некорректная команда, используйте /duel <сумма>")
} else {