🚨 Removed linter warnings
This commit is contained in:
parent
2c730eb012
commit
6add28126b
18 changed files with 80 additions and 82 deletions
|
@ -17,13 +17,13 @@ func Add(msg *tg.Message, pack bool) {
|
|||
return
|
||||
}
|
||||
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
_, err = bot.Bot.SendChatAction(msg.Chat.ID, tg.ActionTyping)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("success_add_sticker"))
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("success_add_sticker"))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
|
||||
if !pack {
|
||||
|
@ -33,16 +33,16 @@ func Add(msg *tg.Message, pack bool) {
|
|||
errors.Check(err)
|
||||
|
||||
if exist {
|
||||
reply.Text = T("error_already_add_sticker")
|
||||
reply.Text = t("error_already_add_sticker")
|
||||
}
|
||||
|
||||
reply.ReplyMarkup = utils.CancelButton(T)
|
||||
reply.ReplyMarkup = utils.CancelButton(t)
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
return
|
||||
}
|
||||
|
||||
reply.Text = T("error_empty_add_pack", map[string]interface{}{
|
||||
reply.Text = t("error_empty_add_pack", map[string]interface{}{
|
||||
"AddStickerCommand": models.CommandAddSticker,
|
||||
})
|
||||
|
||||
|
@ -52,14 +52,14 @@ func Add(msg *tg.Message, pack bool) {
|
|||
errors.Check(err)
|
||||
|
||||
log.Ln("SetTitle:", set.Title)
|
||||
reply.Text = T("success_add_pack", map[string]interface{}{
|
||||
reply.Text = t("success_add_pack", map[string]interface{}{
|
||||
"SetTitle": set.Title,
|
||||
})
|
||||
|
||||
allExists := true
|
||||
for _, sticker := range set.Stickers {
|
||||
for i := range set.Stickers {
|
||||
var exist bool
|
||||
exist, err = db.DB.AddSticker(msg.From, &sticker)
|
||||
exist, err = db.DB.AddSticker(msg.From, &set.Stickers[i])
|
||||
errors.Check(err)
|
||||
|
||||
if !exist {
|
||||
|
@ -69,13 +69,13 @@ func Add(msg *tg.Message, pack bool) {
|
|||
|
||||
log.Ln("All exists?", allExists)
|
||||
if allExists {
|
||||
reply.Text = T("error_already_add_pack", map[string]interface{}{
|
||||
reply.Text = t("error_already_add_pack", map[string]interface{}{
|
||||
"SetTitle": set.Title,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
reply.ReplyMarkup = utils.CancelButton(T)
|
||||
reply.ReplyMarkup = utils.CancelButton(t)
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
}
|
||||
|
|
|
@ -16,15 +16,15 @@ func Delete(msg *tg.Message, pack bool) {
|
|||
return
|
||||
}
|
||||
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
_, err = bot.Bot.SendChatAction(msg.Chat.ID, tg.ActionTyping)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("success_del_sticker"))
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("success_del_sticker"))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.CancelButton(T)
|
||||
reply.ReplyMarkup = utils.CancelButton(t)
|
||||
|
||||
var notExist bool
|
||||
if pack {
|
||||
|
@ -33,18 +33,18 @@ func Delete(msg *tg.Message, pack bool) {
|
|||
errors.Check(err)
|
||||
|
||||
log.Ln("SetName:", set.Title)
|
||||
reply.Text = T("success_del_pack", map[string]interface{}{
|
||||
reply.Text = t("success_del_pack", map[string]interface{}{
|
||||
"SetTitle": set.Title,
|
||||
})
|
||||
|
||||
notExist, err = db.DB.DeletePack(msg.From, msg.Sticker)
|
||||
if notExist {
|
||||
reply.Text = T("error_already_del_pack")
|
||||
reply.Text = t("error_already_del_pack")
|
||||
}
|
||||
} else {
|
||||
notExist, err = db.DB.DeleteSticker(msg.From, msg.Sticker)
|
||||
if notExist {
|
||||
reply.Text = T("error_already_del_sticker")
|
||||
reply.Text = t("error_already_del_sticker")
|
||||
}
|
||||
}
|
||||
errors.Check(err)
|
||||
|
|
|
@ -11,14 +11,14 @@ import (
|
|||
|
||||
// Error action send error reply about invalid user request
|
||||
func Error(msg *tg.Message) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
_, err = bot.Bot.SendChatAction(msg.Chat.ID, tg.ActionTyping)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(
|
||||
msg.Chat.ID, T("error_unknown", map[string]interface{}{
|
||||
msg.Chat.ID, t("error_unknown", map[string]interface{}{
|
||||
"AddStickerCommand": models.CommandAddSticker,
|
||||
"AddPackCommand": models.CommandAddPack,
|
||||
"DeleteStickerCommand": models.CommandDeleteSticker,
|
||||
|
@ -26,7 +26,7 @@ func Error(msg *tg.Message) {
|
|||
}),
|
||||
)
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
|
||||
// Reset action checks key phrase and reset user's pack
|
||||
func Reset(msg *tg.Message) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
err = db.DB.ChangeUserState(msg.From, models.StateNone)
|
||||
|
@ -23,10 +23,10 @@ func Reset(msg *tg.Message) {
|
|||
_, err = bot.Bot.SendChatAction(msg.Chat.ID, tg.ActionTyping)
|
||||
errors.Check(err)
|
||||
|
||||
if !strings.EqualFold(msg.Text, T("key_phrase")) {
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("error_reset_phrase"))
|
||||
if !strings.EqualFold(msg.Text, t("key_phrase")) {
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("error_reset_phrase"))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
|
@ -36,9 +36,9 @@ func Reset(msg *tg.Message) {
|
|||
err = db.DB.ResetUser(msg.From)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("success_reset"))
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("success_reset"))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
}
|
||||
|
|
|
@ -13,21 +13,21 @@ import (
|
|||
|
||||
// Add command prepare user for adding some stickers or sets to his pack
|
||||
func Add(msg *tg.Message, pack bool) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
_, err = bot.Bot.SendChatAction(msg.Chat.ID, tg.ActionTyping)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("reply_add_sticker"))
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("reply_add_sticker"))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.CancelButton(T)
|
||||
reply.ReplyMarkup = utils.CancelButton(t)
|
||||
|
||||
err = db.DB.ChangeUserState(msg.From, models.StateAddSticker)
|
||||
errors.Check(err)
|
||||
|
||||
if pack {
|
||||
reply.Text = T("reply_add_pack")
|
||||
reply.Text = t("reply_add_pack")
|
||||
|
||||
err = db.DB.ChangeUserState(msg.From, models.StateAddPack)
|
||||
errors.Check(err)
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
// Cancel just cancel current user operation
|
||||
func Cancel(msg *tg.Message) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
state, err := db.DB.GetUserState(msg.From)
|
||||
|
@ -24,24 +24,24 @@ func Cancel(msg *tg.Message) {
|
|||
var text string
|
||||
switch state {
|
||||
case models.StateAddSticker:
|
||||
text = T("cancel_add_sticker")
|
||||
text = t("cancel_add_sticker")
|
||||
case models.StateAddPack:
|
||||
text = T("cancel_add_pack")
|
||||
text = t("cancel_add_pack")
|
||||
case models.StateDeleteSticker:
|
||||
text = T("cancel_del_sticker")
|
||||
text = t("cancel_del_sticker")
|
||||
case models.StateDeletePack:
|
||||
text = T("cancel_del_pack")
|
||||
text = t("cancel_del_pack")
|
||||
case models.StateReset:
|
||||
text = T("cancel_reset")
|
||||
text = t("cancel_reset")
|
||||
default:
|
||||
text = T("cancel_error")
|
||||
text = t("cancel_error")
|
||||
}
|
||||
|
||||
err = db.DB.ChangeUserState(msg.From, models.StateNone)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, text)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
// Delete prepare user to remove some stickers or sets from his pack
|
||||
func Delete(msg *tg.Message, pack bool) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
stickers, err := db.DB.GetUserStickers(msg.From, &tg.InlineQuery{})
|
||||
|
@ -25,16 +25,16 @@ func Delete(msg *tg.Message, pack bool) {
|
|||
err = db.DB.ChangeUserState(msg.From, models.StateNone)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("error_empty_del"))
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("error_empty_del"))
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
return
|
||||
}
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("reply_del_sticker"))
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("reply_del_sticker"))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.CancelButton(T)
|
||||
reply.ReplyMarkup = utils.CancelButton(t)
|
||||
|
||||
err = db.DB.ChangeUserState(msg.From, models.StateDeleteSticker)
|
||||
errors.Check(err)
|
||||
|
@ -43,7 +43,7 @@ func Delete(msg *tg.Message, pack bool) {
|
|||
err = db.DB.ChangeUserState(msg.From, models.StateDeletePack)
|
||||
errors.Check(err)
|
||||
|
||||
reply.Text = T("reply_del_pack")
|
||||
reply.Text = t("reply_del_pack")
|
||||
}
|
||||
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
|
@ -52,8 +52,8 @@ func Delete(msg *tg.Message, pack bool) {
|
|||
_, err = bot.Bot.SendChatAction(msg.Chat.ID, tg.ActionTyping)
|
||||
errors.Check(err)
|
||||
|
||||
reply = tg.NewMessage(msg.Chat.ID, T("reply_switch_button"))
|
||||
reply.ReplyMarkup = utils.SwitchButton(T)
|
||||
reply = tg.NewMessage(msg.Chat.ID, t("reply_switch_button"))
|
||||
reply.ReplyMarkup = utils.SwitchButton(t)
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
// Help just send instructions about bot usage
|
||||
func Help(msg *tg.Message) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
err = db.DB.ChangeUserState(msg.From, models.StateNone)
|
||||
|
@ -22,7 +22,7 @@ func Help(msg *tg.Message) {
|
|||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(
|
||||
msg.Chat.ID, T("reply_help", map[string]interface{}{
|
||||
msg.Chat.ID, t("reply_help", map[string]interface{}{
|
||||
"AddStickerCommand": models.CommandAddSticker,
|
||||
"AddPackCommand": models.CommandAddPack,
|
||||
"DeleteStickerCommand": models.CommandDeleteSticker,
|
||||
|
@ -33,7 +33,7 @@ func Help(msg *tg.Message) {
|
|||
}),
|
||||
)
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
|
||||
// Reset prepare user to reset his pack
|
||||
func Reset(msg *tg.Message) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
stickers, err := db.DB.GetUserStickers(msg.From, &tg.InlineQuery{})
|
||||
|
@ -25,9 +25,9 @@ func Reset(msg *tg.Message) {
|
|||
err = db.DB.ChangeUserState(msg.From, models.StateNone)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("error_already_reset"))
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("error_already_reset"))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
return
|
||||
|
@ -36,12 +36,12 @@ func Reset(msg *tg.Message) {
|
|||
err = db.DB.ChangeUserState(msg.From, models.StateReset)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(msg.Chat.ID, T("reply_reset", map[string]interface{}{
|
||||
"KeyPhrase": T("key_phrase"),
|
||||
reply := tg.NewMessage(msg.Chat.ID, t("reply_reset", map[string]interface{}{
|
||||
"KeyPhrase": t("key_phrase"),
|
||||
"CancelCommand": models.CommandCancel,
|
||||
}))
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.CancelButton(T)
|
||||
reply.ReplyMarkup = utils.CancelButton(t)
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
}
|
||||
|
|
|
@ -29,18 +29,18 @@ func Start(msg *tg.Message) {
|
|||
}
|
||||
}
|
||||
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
reply := tg.NewMessage(
|
||||
msg.Chat.ID,
|
||||
T("reply_start", map[string]interface{}{
|
||||
t("reply_start", map[string]interface{}{
|
||||
"Username": bot.Bot.Username,
|
||||
"ID": bot.Bot.ID,
|
||||
}),
|
||||
)
|
||||
reply.ParseMode = tg.StyleMarkdown
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(T)
|
||||
reply.ReplyMarkup = utils.MenuKeyboard(t)
|
||||
|
||||
_, err = bot.Bot.SendMessage(reply)
|
||||
errors.Check(err)
|
||||
|
|
|
@ -41,8 +41,7 @@ func (db *DataBase) DeletePack(user *tg.User, sticker *tg.Sticker) (bool, error)
|
|||
}
|
||||
}
|
||||
|
||||
switch err {
|
||||
case buntdb.ErrNotFound:
|
||||
if err == buntdb.ErrNotFound {
|
||||
log.Ln(user.ID, "not found")
|
||||
return true, nil
|
||||
}
|
||||
|
|
|
@ -19,8 +19,7 @@ func (db *DataBase) UserState(usr *tg.User) (string, error) {
|
|||
return err
|
||||
})
|
||||
|
||||
switch err {
|
||||
case buntdb.ErrNotFound:
|
||||
if err == buntdb.ErrNotFound {
|
||||
log.Ln(usr.ID, "not found, create new one")
|
||||
if err = db.ChangeUserState(usr, models.StateNone); err != nil {
|
||||
return state, err
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
)
|
||||
|
||||
// SwitchTo try load locales by input language codes and return TranslateFunc
|
||||
func SwitchTo(codes ...string) (T i18n.TranslateFunc, err error) {
|
||||
func SwitchTo(codes ...string) (t i18n.TranslateFunc, err error) {
|
||||
codes = append(codes, models.LanguageFallback)
|
||||
T, err = i18n.Tfunc(codes[0], codes[1:]...)
|
||||
t, err = i18n.Tfunc(codes[0], codes[1:]...)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -13,21 +13,21 @@ import (
|
|||
// Message checks user message on response, stickers, reset key phrase, else do
|
||||
// Actions
|
||||
func Message(msg *tg.Message) {
|
||||
T, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(msg.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
switch {
|
||||
case strings.EqualFold(msg.Text, T("button_add_sticker")):
|
||||
case strings.EqualFold(msg.Text, t("button_add_sticker")):
|
||||
commands.Add(msg, false)
|
||||
case strings.EqualFold(msg.Text, T("button_add_pack")):
|
||||
case strings.EqualFold(msg.Text, t("button_add_pack")):
|
||||
commands.Add(msg, true)
|
||||
case strings.EqualFold(msg.Text, T("button_del_sticker")):
|
||||
case strings.EqualFold(msg.Text, t("button_del_sticker")):
|
||||
commands.Delete(msg, false)
|
||||
case strings.EqualFold(msg.Text, T("button_del_pack")):
|
||||
case strings.EqualFold(msg.Text, t("button_del_pack")):
|
||||
commands.Delete(msg, true)
|
||||
case strings.EqualFold(msg.Text, T("button_reset")):
|
||||
case strings.EqualFold(msg.Text, t("button_reset")):
|
||||
commands.Reset(msg)
|
||||
case strings.EqualFold(msg.Text, T("button_cancel")):
|
||||
case strings.EqualFold(msg.Text, t("button_cancel")):
|
||||
commands.Cancel(msg)
|
||||
default:
|
||||
actions.Action(msg)
|
||||
|
|
|
@ -31,7 +31,7 @@ func InlineQuery(inlineQuery *tg.InlineQuery) {
|
|||
}
|
||||
|
||||
log.Ln("Let's preparing answer...")
|
||||
T, err := i18n.SwitchTo(inlineQuery.From.LanguageCode)
|
||||
t, err := i18n.SwitchTo(inlineQuery.From.LanguageCode)
|
||||
errors.Check(err)
|
||||
|
||||
log.Ln("INLINE OFFSET:", inlineQuery.Offset)
|
||||
|
@ -54,7 +54,7 @@ func InlineQuery(inlineQuery *tg.InlineQuery) {
|
|||
if len(stickers) == 0 {
|
||||
if offset == 0 && inlineQuery.Query != "" {
|
||||
// If search stickers by emoji return 0 results
|
||||
answer.SwitchPrivateMessageText = T(
|
||||
answer.SwitchPrivateMessageText = t(
|
||||
"button_inline_nothing", map[string]interface{}{
|
||||
"Query": inlineQuery.Query,
|
||||
},
|
||||
|
|
|
@ -6,10 +6,10 @@ import (
|
|||
)
|
||||
|
||||
// CancelButton helper just generate ReplyMarkup with cancel button
|
||||
func CancelButton(T i18n.TranslateFunc) *tg.ReplyKeyboardMarkup {
|
||||
func CancelButton(t i18n.TranslateFunc) *tg.ReplyKeyboardMarkup {
|
||||
return tg.NewReplyKeyboardMarkup(
|
||||
tg.NewReplyKeyboardRow(
|
||||
tg.NewReplyKeyboardButton(T("button_cancel")),
|
||||
tg.NewReplyKeyboardButton(t("button_cancel")),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -6,18 +6,18 @@ import (
|
|||
)
|
||||
|
||||
// MenuKeyboard helper just generate ReplyMarkup with menu buttons
|
||||
func MenuKeyboard(T i18n.TranslateFunc) *tg.ReplyKeyboardMarkup {
|
||||
func MenuKeyboard(t i18n.TranslateFunc) *tg.ReplyKeyboardMarkup {
|
||||
return tg.NewReplyKeyboardMarkup(
|
||||
tg.NewReplyKeyboardRow(
|
||||
tg.NewReplyKeyboardButton(T("button_add_sticker")),
|
||||
tg.NewReplyKeyboardButton(T("button_add_pack")),
|
||||
tg.NewReplyKeyboardButton(t("button_add_sticker")),
|
||||
tg.NewReplyKeyboardButton(t("button_add_pack")),
|
||||
),
|
||||
tg.NewReplyKeyboardRow(
|
||||
tg.NewReplyKeyboardButton(T("button_del_sticker")),
|
||||
tg.NewReplyKeyboardButton(T("button_del_pack")),
|
||||
tg.NewReplyKeyboardButton(t("button_del_sticker")),
|
||||
tg.NewReplyKeyboardButton(t("button_del_pack")),
|
||||
),
|
||||
tg.NewReplyKeyboardRow(
|
||||
tg.NewReplyKeyboardButton(T("button_reset")),
|
||||
tg.NewReplyKeyboardButton(t("button_reset")),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ import (
|
|||
)
|
||||
|
||||
// SwitchButton helper just generate ReplyMarkup with SelfSwitch button
|
||||
func SwitchButton(T i18n.TranslateFunc) *tg.InlineKeyboardMarkup {
|
||||
func SwitchButton(t i18n.TranslateFunc) *tg.InlineKeyboardMarkup {
|
||||
return tg.NewInlineKeyboardMarkup(
|
||||
tg.NewInlineKeyboardRow(
|
||||
tg.NewInlineKeyboardButtonSwitchSelf(T("button_inline_select"), " "),
|
||||
tg.NewInlineKeyboardButtonSwitchSelf(t("button_inline_select"), " "),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue