"Get that shit outta my master."
This commit is contained in:
4
go.mod
4
go.mod
@@ -4,7 +4,7 @@ go 1.26.1
|
||||
|
||||
require (
|
||||
git.nix13.pw/scuroneko/extypes v1.2.1
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.20
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.21
|
||||
git.nix13.pw/scuroneko/slog v1.0.2
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/joho/godotenv v1.5.1
|
||||
@@ -15,7 +15,7 @@ require (
|
||||
go.mongodb.org/mongo-driver/v2 v2.5.0
|
||||
)
|
||||
|
||||
//replace git.nix13.pw/scuroneko/laniakea v1.0.0-beta.20 => ./laniakea
|
||||
//replace git.nix13.pw/scuroneko/laniakea v1.0.0-beta.21 => ./laniakea
|
||||
//replace git.nix13.pw/scuroneko/extypes v1.2.1 => ../go-extypes
|
||||
//replace git.nix13.pw/scuroneko/slog v1.0.2 => ../slog
|
||||
|
||||
|
||||
4
go.sum
4
go.sum
@@ -2,8 +2,8 @@ filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw=
|
||||
filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
git.nix13.pw/scuroneko/extypes v1.2.1 h1:IYrOjnWKL2EAuJYtYNa+luB1vBe6paE8VY/YD+5/RpQ=
|
||||
git.nix13.pw/scuroneko/extypes v1.2.1/go.mod h1:uZVs8Yo3RrYAG9dMad6qR6lsYY67t+459D9c65QAYAw=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.20 h1:UrKFl0Nk73NmUODnUumxtiBgAByXaOqRQlQT55AK/dk=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.20/go.mod h1:M8jwm195hzAl9bj9Bkl95WfHmWvuBX6micsdtOs/gmE=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.21 h1:bit6fm6xtwoDh3BTjKduzyg++4BLiiQ392NmxnSr5lI=
|
||||
git.nix13.pw/scuroneko/laniakea v1.0.0-beta.21/go.mod h1:M8jwm195hzAl9bj9Bkl95WfHmWvuBX6micsdtOs/gmE=
|
||||
git.nix13.pw/scuroneko/slog v1.0.2 h1:vZyUROygxC2d5FJHUQM/30xFEHY1JT/aweDZXA4rm2g=
|
||||
git.nix13.pw/scuroneko/slog v1.0.2/go.mod h1:3Qm2wzkR5KjwOponMfG7TcGSDjmYaFqRAmLvSPTuWJI=
|
||||
github.com/alitto/pond/v2 v2.7.0 h1:c76L+yN916m/DRXjGCeUBHHu92uWnh/g1bwVk4zyyXg=
|
||||
|
||||
2
main.go
2
main.go
@@ -38,7 +38,7 @@ func main() {
|
||||
plugins.RegisterAi(),
|
||||
plugins.RegisterFun(),
|
||||
plugins.RegisterProxy(),
|
||||
)
|
||||
).SetPayloadType(laniakea.BotPayloadJson)
|
||||
|
||||
if err := bot.AutoGenerateCommands(); err != nil {
|
||||
log.Println(err)
|
||||
|
||||
@@ -27,7 +27,7 @@ func getH2Link(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
func getProxy(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
ruProxy := "tg://proxy?port=3128&secret=7qaZyfQN-IQ7ZMwrR_zWnHBvem9uLnJ1&server=185.231.245.25"
|
||||
fiProxy := "tg://proxy?port=3128&secret=7vmNtw_233xvIRFvImm2PLtvem9uLnJ1&server=46.243.6.125"
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddUrlButtonStyle("🇷🇺Russia", laniakea.ButtonStylePrimary, ruProxy)
|
||||
kb.AddUrlButtonStyle("🇫🇮Finland", laniakea.ButtonStylePrimary, fiProxy)
|
||||
ctx.Keyboard("Доступные прокси", kb)
|
||||
|
||||
@@ -73,7 +73,7 @@ func rpInfo(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
if count == 0 {
|
||||
kb := laniakea.NewInlineKeyboard(1).AddCallbackButton("Закрыть", "general.close")
|
||||
kb := laniakea.NewInlineKeyboardJson(1).AddCallbackButton("Закрыть", "general.close")
|
||||
ctx.Keyboard("Для доступа к этой команде нужно иметь хотя бы одну вайфу", kb)
|
||||
return
|
||||
}
|
||||
@@ -121,7 +121,7 @@ func rpInfo(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
"Что бы установить описание персонажа, используй `/rpuserpset \"описание персонажа\"` без кавычек.",
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
kb.AddCallbackButton("Статистика чата", "rp.chat_stat")
|
||||
kb.AddCallbackButton("Сменить вайфу", "rp.waifu_list")
|
||||
kb.AddCallbackButton("Сменить пресет", "rp.preset_list")
|
||||
@@ -165,14 +165,14 @@ func rpWaifuList(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
})
|
||||
|
||||
out := make([]string, len(waifus))
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
for i, waifu := range waifus {
|
||||
owner := "нет"
|
||||
if waifu.OwnerID.Valid && waifu.Owner != nil {
|
||||
owner = waifu.Owner.Name
|
||||
}
|
||||
out[i] = fmt.Sprintf(
|
||||
"*%s* %d☆ из \"%s\" (владелец: %s)",
|
||||
"*%s* %d☆ из \"%s\" \\(владелец: %s\\)",
|
||||
waifu.Name, waifu.Rarity, waifu.Fandom, owner,
|
||||
)
|
||||
kb.AddCallbackButton(waifu.Name, "rp.waifu_set", waifu.ID)
|
||||
@@ -201,7 +201,7 @@ func rpWaifuSet(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
ctx.Error(err)
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStyleSuccess, "rp.info")
|
||||
ctx.EditCallbackfMarkdown("Была выбрана вайфу *%s*", kb, waifu.Name)
|
||||
ctx.AnswerCbQuery()
|
||||
@@ -215,11 +215,11 @@ func rpPresetsList(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
out := make([]string, len(presets))
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
for i, preset := range presets {
|
||||
out[i] = fmt.Sprintf(
|
||||
"*%s* \\- %s",
|
||||
laniakea.EscapeMarkdownV2(preset.Name), preset.Description,
|
||||
laniakea.EscapeMarkdownV2(preset.Name), laniakea.EscapePunctuation(preset.Description),
|
||||
)
|
||||
kb.AddCallbackButton(preset.Name, "rp.preset_set", preset.ID)
|
||||
}
|
||||
@@ -249,7 +249,7 @@ func rpPresetSet(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStylePrimary, "rp.info")
|
||||
ctx.EditCallbackf("Был выбран пресет %s", kb, preset.Name)
|
||||
ctx.AnswerCbQuery()
|
||||
@@ -264,7 +264,7 @@ func rpModelList(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
|
||||
out := make([]string, len(models))
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
for i, model := range models {
|
||||
out[i] = fmt.Sprintf("*%s* \\- размер контекста _%dK_", laniakea.EscapeMarkdownV2(model.Name), model.ContextSize)
|
||||
kb.AddCallbackButton(model.Name, "rp.model_set", model.ID)
|
||||
@@ -293,7 +293,7 @@ func rpModelSet(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
ctx.Error(err)
|
||||
return
|
||||
}
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStyleSuccess, "rp.info")
|
||||
ctx.EditCallback(fmt.Sprintf("Была установлена модель %s", model.Name), kb)
|
||||
ctx.AnswerCbQuery()
|
||||
@@ -307,12 +307,12 @@ func rpScenarioList(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
out := make([]string, len(scenarios))
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
for i, scenario := range scenarios {
|
||||
out[i] = fmt.Sprintf("*%s* \\- %s\n", scenario.Name, scenario.Description)
|
||||
out[i] = fmt.Sprintf("*%s* \\- %s\n", scenario.Name, laniakea.EscapePunctuation(scenario.Description))
|
||||
}
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStyleDanger, "rp.info")
|
||||
ctx.EditCallbackMarkdown("Список сценариев\n"+strings.Join(out, "\n"), kb)
|
||||
ctx.EditCallbackMarkdown(strings.Join(out, "\n"), kb)
|
||||
ctx.AnswerCbQuery()
|
||||
}
|
||||
func rpSettingList(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
@@ -325,9 +325,9 @@ func rpSettingList(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
|
||||
out := make([]string, len(settings))
|
||||
for i, setting := range settings {
|
||||
out[i] = fmt.Sprintf("*%s* \\- %s\n", setting.Name, setting.Description)
|
||||
out[i] = fmt.Sprintf("*%s* \\- %s\n", setting.Name, laniakea.EscapePunctuation(setting.Description))
|
||||
}
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStyleSuccess, "rp.info")
|
||||
ctx.EditCallbackMarkdown(strings.Join(out, "\n"), kb)
|
||||
ctx.AnswerCbQuery()
|
||||
@@ -346,7 +346,7 @@ func chatStat(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("Сжать чат", laniakea.ButtonStyleSuccess, "rp.compress_chat")
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStyleDanger, "rp.info")
|
||||
out := []string{
|
||||
@@ -362,7 +362,7 @@ func chatStat(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
if scenario.ID == 0 {
|
||||
continue
|
||||
}
|
||||
scenarioNames[i] = fmt.Sprintf("%s (ID: %d)", scenario.Name, scenario.ID)
|
||||
scenarioNames[i] = fmt.Sprintf("%s \\(ID: %d\\)", scenario.Name, scenario.ID)
|
||||
}
|
||||
out = append(out, fmt.Sprintf("*Выбранные сценарии*: %s", strings.Join(scenarioNames, ", ")))
|
||||
}
|
||||
@@ -386,9 +386,9 @@ func newChatStage1(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
out := []string{
|
||||
"Выбери сеттинг для чата",
|
||||
}
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
for _, setting := range settings {
|
||||
out = append(out, fmt.Sprintf("*%s* \\- %s", setting.Name, setting.Description))
|
||||
out = append(out, fmt.Sprintf("*%s* \\- %s", setting.Name, laniakea.EscapePunctuation(setting.Description)))
|
||||
kb.AddCallbackButton(setting.Name, "rp.new_chat_s2", setting.ID)
|
||||
}
|
||||
kb.AddCallbackButton("Без сеттинга", "rp.new_chat_s2", 0)
|
||||
@@ -421,10 +421,8 @@ func newChatStage2(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
selectedScenariosIds = utils.Map(ctx.Args[1:], utils.StringToInt)
|
||||
}
|
||||
|
||||
out := []string{
|
||||
"Выбери сценарий:",
|
||||
}
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
var out []string
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
var scenariosIds extypes.Slice[int]
|
||||
for _, scenario := range scenarios {
|
||||
isSelected := selectedScenariosIds.Index(scenario.ID) >= 0
|
||||
@@ -434,7 +432,7 @@ func newChatStage2(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
prefix = "✅"
|
||||
style = laniakea.ButtonStyleSuccess
|
||||
}
|
||||
out = append(out, fmt.Sprintf("%s*%s* - %s", prefix, scenario.Name, scenario.Description))
|
||||
out = append(out, fmt.Sprintf("%s*%s* \\- %s", prefix, scenario.Name, laniakea.EscapePunctuation(scenario.Description)))
|
||||
if isSelected {
|
||||
scenariosIds = selectedScenariosIds.Remove(scenario.ID)
|
||||
} else {
|
||||
@@ -452,7 +450,7 @@ func newChatStage2(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
kb.AddCallbackButtonStyle("Создать", laniakea.ButtonStyleSuccess, "rp.new_chat", utils.AppendToInt(settingId, selectedScenariosIds)...)
|
||||
kb.AddLine()
|
||||
kb.AddCallbackButtonStyle("Назад", laniakea.ButtonStyleDanger, "rp.new_chat_s1")
|
||||
ctx.EditCallbackMarkdown(laniakea.EscapePunctuation(strings.Join(out, "\n")), kb)
|
||||
ctx.EditCallbackMarkdown(strings.Join(out, "\n"), kb)
|
||||
|
||||
//setting, err := rep.GetSetting(settingId)
|
||||
//if err != nil {
|
||||
@@ -534,7 +532,7 @@ func newChat(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStyleSuccess, "rp.info")
|
||||
kb.AddCallbackButtonStyle("Закрыть", laniakea.ButtonStyleDanger, "general.close")
|
||||
ctx.EditCallbackMarkdown("Был создан новый чат\\. Для общения используй `/г промпт`", kb)
|
||||
@@ -653,7 +651,7 @@ func generate(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
userMessage := strings.TrimSpace(strings.Join(ctx.Args, " "))
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("Отменить", laniakea.ButtonStyleDanger, "rp.cancel")
|
||||
m := ctx.Keyboard("Генерация запущена...", kb)
|
||||
ctx.SendAction(tgapi.ChatActionTyping)
|
||||
@@ -768,7 +766,7 @@ func generate(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
ctx.Error(err)
|
||||
}
|
||||
|
||||
kb = laniakea.NewInlineKeyboard(1)
|
||||
kb = laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("🔄 Перегенерировать 🔄", laniakea.ButtonStyleSuccess, "rp.regenerate", counter+2)
|
||||
ctx.Keyboard(answerContent, kb)
|
||||
|
||||
@@ -859,7 +857,7 @@ func regenerateResponse(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("🔄 Перегенерировать 🔄", laniakea.ButtonStyleSuccess, "rp.regenerate", count)
|
||||
ctx.EditCallback(res.Choices[0].Message.Content, kb)
|
||||
}
|
||||
@@ -868,7 +866,7 @@ func compress(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
ctx.AnswerCbQueryText("Запущено сжатие чата…")
|
||||
m := ctx.Answer("Запущено сжатие чата…")
|
||||
_compress(ctx, db)
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButton("Назад", "rp.chat_stat")
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStyleDanger, "rp.info")
|
||||
m.Delete()
|
||||
@@ -982,7 +980,7 @@ var tokenMethodCount = []int{
|
||||
}
|
||||
|
||||
func compressSettingStage1(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
kb.AddCallbackButton("По сообщениям", "rp.compress_setting_s2", "messages")
|
||||
kb.AddCallbackButton("По токенам", "rp.compress_setting_s2", "tokens")
|
||||
kb.AddCallbackButton("Отключить", "rp.compress_setting", "none", 0)
|
||||
@@ -1005,7 +1003,7 @@ func compressSettingStage2(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
"При выборе маленьких значений, чат будет сжиматься чаще, что замедляет вывод сообщений.",
|
||||
"При выборе слишком больших значений, некоторые детали могут теряться.",
|
||||
}
|
||||
kb := laniakea.NewInlineKeyboard(3)
|
||||
kb := laniakea.NewInlineKeyboardJson(3)
|
||||
switch method {
|
||||
case "messages":
|
||||
out = append(out, "Выбери количество сообщений, после которых будет происходить сжатие чата")
|
||||
@@ -1045,7 +1043,7 @@ func compressSetting(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
if err != nil {
|
||||
ctx.Error(err)
|
||||
}
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButtonStyle("На главную", laniakea.ButtonStylePrimary, "rp.info")
|
||||
ctx.EditCallback("Настройки сжатия были обновлены", kb)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ func about(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
fmt.Sprintf("*Git хеш*: %s", utils.GitCommit),
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
kb.AddUrlButtonStyle("Канал", laniakea.ButtonStylePrimary, "https://t.me/ym_gbot_news")
|
||||
kb.AddUrlButtonStyle("Чат", laniakea.ButtonStylePrimary, "https://t.me/ym_gbot_chat")
|
||||
ctx.KeyboardMarkdown(laniakea.EscapePunctuation(strings.Join(out, "\n")), kb)
|
||||
|
||||
@@ -51,7 +51,7 @@ func myWaifu(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
out := []string{
|
||||
fmt.Sprintf("%s, %s!", user.Greeting, user.Name),
|
||||
"Список твоих вайфу:",
|
||||
@@ -82,7 +82,7 @@ func waifuList(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
out := make([]string, len(waifus))
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
for i, w := range waifus {
|
||||
var owner string
|
||||
if w.Owner == nil {
|
||||
@@ -140,7 +140,7 @@ func waifuSell(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
fmt.Sprintf("Цена продажи составляет %s", utils.DecimalComma(&waifu.MarketPrice)),
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(1)
|
||||
kb := laniakea.NewInlineKeyboardJson(1)
|
||||
kb.AddCallbackButton("Продать", "waifu.confirm_sell", waifu.ID)
|
||||
kb.AddCallbackButton("Отмена", "waifu.info", waifu.ID)
|
||||
ctx.CallbackDelete()
|
||||
@@ -177,7 +177,7 @@ func waifuInfo(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
laniakea.EscapePunctuation(fmt.Sprintf("Бонус к опыту: x%.2f", waifu.ExpBonus.InexactFloat64())),
|
||||
fmt.Sprintf("Рыночная стоимость: %s¥", utils.DecimalComma(&waifu.MarketPrice)),
|
||||
}
|
||||
kb := laniakea.NewInlineKeyboard(2)
|
||||
kb := laniakea.NewInlineKeyboardJson(2)
|
||||
if !waifu.OwnerID.Valid {
|
||||
kb.AddCallbackButton("Купить", "waifu.buy", waifu.ID)
|
||||
}
|
||||
@@ -209,7 +209,7 @@ func waifuSearch(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
kb := laniakea.NewInlineKeyboard(2).AddCallbackButton("Мои вайфу", "waifu.my").AddCallbackButton("Все вайфу", "waifu.list")
|
||||
kb := laniakea.NewInlineKeyboardJson(2).AddCallbackButton("Мои вайфу", "waifu.my").AddCallbackButton("Все вайфу", "waifu.list")
|
||||
if time.Now().Before(user.WaifuSearchTime.Add(time.Hour * 4)) {
|
||||
ctx.EditCallback("Вайфу можно искать раз в 4 часа", kb)
|
||||
return
|
||||
@@ -269,6 +269,6 @@ func waifuSearch(ctx *laniakea.MsgContext, db *database.Context) {
|
||||
}
|
||||
|
||||
func waifuNotImplemented(ctx *laniakea.MsgContext, _ *database.Context) {
|
||||
kb := laniakea.NewInlineKeyboard(2).AddCallbackButton("Мои вайфу", "waifu.my").AddCallbackButton("Все вайфу", "waifu.list")
|
||||
kb := laniakea.NewInlineKeyboardJson(2).AddCallbackButton("Мои вайфу", "waifu.my").AddCallbackButton("Все вайфу", "waifu.list")
|
||||
ctx.EditCallback("Данная функция ещё не реализована", kb)
|
||||
}
|
||||
|
||||
@@ -12,14 +12,14 @@ CREATE TABLE groups (
|
||||
);
|
||||
|
||||
CREATE TABLE users (
|
||||
id int8 NOT NULL PRIMARY KEY,
|
||||
balance decimal(20,0) NOT NULL DEFAULT 0,
|
||||
name text NOT NULL,
|
||||
group_id int NOT NULL DEFAULT 1 REFERENCES groups(id),
|
||||
level int DEFAULT 1,
|
||||
exp int DEFAULT 0,
|
||||
work_id int NOT NULL DEFAULT 1 REFERENCES works(id),
|
||||
work_time timestamp DEFAULT now(),
|
||||
id INT8 NOT NULL PRIMARY KEY,
|
||||
balance DECIMAL(20,0) NOT NULL DEFAULT 0,
|
||||
name TEXT NOT NULL,
|
||||
group_id INT NOT NULL DEFAULT 1 REFERENCES groups(id),
|
||||
level INT DEFAULT 1,
|
||||
exp DECIMAL(20, 0) DEFAULT 0,
|
||||
work_id INT NOT NULL DEFAULT 1 REFERENCES works(id),
|
||||
work_time TIMESTAMP DEFAULT now(),
|
||||
|
||||
auto_id int DEFAULT NULL,
|
||||
business_id int DEFAULT NULL,
|
||||
@@ -35,7 +35,7 @@ CREATE TABLE users (
|
||||
fraction_id int DEFAULT NULL,
|
||||
|
||||
money_income decimal(20, 0) DEFAULT 0,
|
||||
exp_income int DEFAULT 0,
|
||||
exp_income decimal(20, 0) DEFAULT 0,
|
||||
btc_income decimal(16, 6) DEFAULT 0,
|
||||
|
||||
waifu_search_time timestamp DEFAULT now()
|
||||
|
||||
Reference in New Issue
Block a user