|
@@ -439,16 +439,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
|
|
if len(dataArray) == 4 {
|
|
if len(dataArray) == 4 {
|
|
|
num, err := strconv.Atoi(dataArray[3])
|
|
num, err := strconv.Atoi(dataArray[3])
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
- switch num {
|
|
|
|
|
- case -2:
|
|
|
|
|
- inputNumber = 0
|
|
|
|
|
- case -1:
|
|
|
|
|
- if inputNumber > 0 {
|
|
|
|
|
- inputNumber = (inputNumber / 10)
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- inputNumber = (inputNumber * 10) + num
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ inputNumber = updateNumericInput(inputNumber, num)
|
|
|
}
|
|
}
|
|
|
if inputNumber == oldInputNumber {
|
|
if inputNumber == oldInputNumber {
|
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
@@ -509,16 +500,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
|
|
if len(dataArray) == 3 {
|
|
if len(dataArray) == 3 {
|
|
|
num, err := strconv.Atoi(dataArray[2])
|
|
num, err := strconv.Atoi(dataArray[2])
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
- switch num {
|
|
|
|
|
- case -2:
|
|
|
|
|
- inputNumber = 0
|
|
|
|
|
- case -1:
|
|
|
|
|
- if inputNumber > 0 {
|
|
|
|
|
- inputNumber = (inputNumber / 10)
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- inputNumber = (inputNumber * 10) + num
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ inputNumber = updateNumericInput(inputNumber, num)
|
|
|
}
|
|
}
|
|
|
if inputNumber == oldInputNumber {
|
|
if inputNumber == oldInputNumber {
|
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
@@ -639,16 +621,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
|
|
if len(dataArray) == 4 {
|
|
if len(dataArray) == 4 {
|
|
|
num, err := strconv.Atoi(dataArray[3])
|
|
num, err := strconv.Atoi(dataArray[3])
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
- switch num {
|
|
|
|
|
- case -2:
|
|
|
|
|
- inputNumber = 0
|
|
|
|
|
- case -1:
|
|
|
|
|
- if inputNumber > 0 {
|
|
|
|
|
- inputNumber = (inputNumber / 10)
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- inputNumber = (inputNumber * 10) + num
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ inputNumber = updateNumericInput(inputNumber, num)
|
|
|
}
|
|
}
|
|
|
if inputNumber == oldInputNumber {
|
|
if inputNumber == oldInputNumber {
|
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
@@ -721,16 +694,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
|
|
if len(dataArray) == 3 {
|
|
if len(dataArray) == 3 {
|
|
|
num, err := strconv.Atoi(dataArray[2])
|
|
num, err := strconv.Atoi(dataArray[2])
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
- switch num {
|
|
|
|
|
- case -2:
|
|
|
|
|
- inputNumber = 0
|
|
|
|
|
- case -1:
|
|
|
|
|
- if inputNumber > 0 {
|
|
|
|
|
- inputNumber = (inputNumber / 10)
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- inputNumber = (inputNumber * 10) + num
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ inputNumber = updateNumericInput(inputNumber, num)
|
|
|
}
|
|
}
|
|
|
if inputNumber == oldInputNumber {
|
|
if inputNumber == oldInputNumber {
|
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
@@ -827,16 +791,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
|
|
if len(dataArray) == 4 {
|
|
if len(dataArray) == 4 {
|
|
|
num, err := strconv.Atoi(dataArray[3])
|
|
num, err := strconv.Atoi(dataArray[3])
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
- switch num {
|
|
|
|
|
- case -2:
|
|
|
|
|
- inputNumber = 0
|
|
|
|
|
- case -1:
|
|
|
|
|
- if inputNumber > 0 {
|
|
|
|
|
- inputNumber = (inputNumber / 10)
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- inputNumber = (inputNumber * 10) + num
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ inputNumber = updateNumericInput(inputNumber, num)
|
|
|
}
|
|
}
|
|
|
if inputNumber == oldInputNumber {
|
|
if inputNumber == oldInputNumber {
|
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
@@ -900,16 +855,7 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool
|
|
|
if len(dataArray) == 3 {
|
|
if len(dataArray) == 3 {
|
|
|
num, err := strconv.Atoi(dataArray[2])
|
|
num, err := strconv.Atoi(dataArray[2])
|
|
|
if err == nil {
|
|
if err == nil {
|
|
|
- switch num {
|
|
|
|
|
- case -2:
|
|
|
|
|
- inputNumber = 0
|
|
|
|
|
- case -1:
|
|
|
|
|
- if inputNumber > 0 {
|
|
|
|
|
- inputNumber = (inputNumber / 10)
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- inputNumber = (inputNumber * 10) + num
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ inputNumber = updateNumericInput(inputNumber, num)
|
|
|
}
|
|
}
|
|
|
if inputNumber == oldInputNumber {
|
|
if inputNumber == oldInputNumber {
|
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|
|
t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.successfulOperation"))
|