fix(tgbot): keep backup files in the chat and the menu below them (#7092)

Every bot notice carries a Hide button, which deletes the message it sits on.
On a backup that message is the file itself: one tap, with no confirmation,
could remove the admin's only copy of the database. Backup files (the .db and
config.json, from the backup button, the scheduled job and the panel's
backup-to-Telegram endpoint) are now sent without a keyboard; other notices,
including the ban log file, keep Hide.

The backup button also left the menu above the files it sent, out of view at
the bottom of the chat. It now sends the Maintenance menu again below them and
removes the old one. A scheduled backup leaves the menu where it is.
This commit is contained in:
PluS98
2026-11-13 02:42:16 +03:00
committed by GitHub
parent 243b5c9da7
commit 3a28d130a7
8 changed files with 168 additions and 15 deletions
+2 -2
View File
@@ -89,11 +89,11 @@ func (t *Tgbot) categoryRows(category string) [][]telego.InlineKeyboardButton {
// screenCategory draws one menu subject. The hint line names the subject, so a
// user who arrived through a notification can see where they are.
func (t *Tgbot) screenCategory(chatID int64, category string) {
func (t *Tgbot) screenCategory(chatID int64, category string, delivery ...screenDelivery) {
body := t.I18nBot("tgbot.messages.category_" + category)
rows := [][]telego.InlineKeyboardButton{}
rows = append(rows, t.categoryRows(category)...)
t.renderScreen(chatID, t.newScreen("main", body, rows...))
t.renderScreen(chatID, t.newScreen("main", body, rows...), delivery...)
}
// btn is where a localized label becomes a callback button; btn2 is btn with a