From 410b997b2fc26f0287b30b1407c22b1e8c1391d2 Mon Sep 17 00:00:00 2001 From: Umputun Date: Sat, 16 Dec 2023 00:53:55 -0600 Subject: [PATCH] change button label as this is not just unban but also confirm it for good --- app/events/events.go | 2 +- app/events/events_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/events/events.go b/app/events/events.go index c52c2d76..be8a480e 100644 --- a/app/events/events.go +++ b/app/events/events.go @@ -322,7 +322,7 @@ func (l *TelegramListener) reportToAdminChat(banUserStr string, msg *bot.Message log.Printf("[DEBUG] report to admin chat, ban data for %s, group: %d", banUserStr, l.adminChatID) text := strings.ReplaceAll(escapeMarkDownV1Text(msg.Text), "\n", " ") forwardMsg := fmt.Sprintf("**permanently banned [%s](tg://user?id=%d)**\n\n%s\n\n", banUserStr, msg.From.ID, text) - if err := l.sendUnban(forwardMsg, "unban user", msg.From, l.adminChatID); err != nil { + if err := l.sendUnban(forwardMsg, "change ban status for user", msg.From, l.adminChatID); err != nil { log.Printf("[WARN] failed to send admin message, %v", err) } } diff --git a/app/events/events_test.go b/app/events/events_test.go index 7bfa94e8..e373ac1e 100644 --- a/app/events/events_test.go +++ b/app/events/events_test.go @@ -902,7 +902,7 @@ func TestTelegramListener_reportToAdminChat(t *testing.T) { assert.Contains(t, mockAPI.SendCalls()[0].C.(tbapi.MessageConfig).Text, "permanently banned [testUser](tg://user?id=456)") assert.Contains(t, mockAPI.SendCalls()[0].C.(tbapi.MessageConfig).Text, "Test \\_message\\_") assert.NotNil(t, mockAPI.SendCalls()[0].C.(tbapi.MessageConfig).ReplyMarkup) - assert.Equal(t, "unban user", + assert.Equal(t, "change ban status for user", mockAPI.SendCalls()[0].C.(tbapi.MessageConfig).ReplyMarkup.(tbapi.InlineKeyboardMarkup).InlineKeyboard[0][0].Text) }