Исправлен баг с отрицательными значениями
This commit is contained in:
@@ -53,12 +53,6 @@ func (s *DuelController) StartMatch(c tele.Context) error {
|
|||||||
return c.Send("Некоректная команда, используйте /duel <сумма>")
|
return c.Send("Некоректная команда, используйте /duel <сумма>")
|
||||||
}
|
}
|
||||||
|
|
||||||
s.Inited = true
|
|
||||||
s.PlayerOne.ID = c.Sender().ID
|
|
||||||
s.PlayerOne.FName = c.Sender().FirstName
|
|
||||||
|
|
||||||
user := s.DC.GetUser(s.PlayerOne.ID)
|
|
||||||
|
|
||||||
summ, err := strconv.Atoi(text)
|
summ, err := strconv.Atoi(text)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.Send("Некорректная команда, используйте /duel <сумма>")
|
return c.Send("Некорректная команда, используйте /duel <сумма>")
|
||||||
@@ -66,14 +60,20 @@ func (s *DuelController) StartMatch(c tele.Context) error {
|
|||||||
s.Summ = summ
|
s.Summ = summ
|
||||||
}
|
}
|
||||||
|
|
||||||
if user.DickSize < summ {
|
|
||||||
return c.Send("У вас недостаточно длинный пенис для состязания!")
|
|
||||||
}
|
|
||||||
|
|
||||||
if summ <= 0 {
|
if summ <= 0 {
|
||||||
return c.Send("Некорректная сумма, используйте положительное значение!")
|
return c.Send("Некорректная сумма, используйте положительное значение!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.Inited = true
|
||||||
|
s.PlayerOne.ID = c.Sender().ID
|
||||||
|
s.PlayerOne.FName = c.Sender().FirstName
|
||||||
|
|
||||||
|
user := s.DC.GetUser(s.PlayerOne.ID)
|
||||||
|
|
||||||
|
if user.DickSize < summ {
|
||||||
|
return c.Send("У вас недостаточно длинный пенис для состязания!")
|
||||||
|
}
|
||||||
|
|
||||||
return c.Send(fmt.Sprintf("%s начал дуель, ставка: %d", s.PlayerOne.FName, summ))
|
return c.Send(fmt.Sprintf("%s начал дуель, ставка: %d", s.PlayerOne.FName, summ))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user