Skip to content

Commit

Permalink
change button label as this is not just unban but also confirm it for…
Browse files Browse the repository at this point in the history
… good
  • Loading branch information
umputun committed Dec 16, 2023
1 parent ffb0c29 commit 410b997
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/events/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 410b997

Please sign in to comment.