You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: NOT SPAM button in potential spam was banning users (#98)
For potential spam, both KILL and NOT SPAM buttons shared the same callback with Spam type. Now each button has its own callback with correct type. Added tests and helper for cleanup of related callbacks.
letlogMsg= $"{msgType} spam (score: {score}) in {prependUsername message.Chat.Username} ({message.Chat.Id}) from {prependUsername message.From.Username} ({message.From.Id}) with text:\n{message.TextOrCaption}"
486
486
487
-
// Determine which topic and what buttons
488
-
lettopicId,replyMarkup =
487
+
// Determine which topic
488
+
lettopicId=
489
+
if deleteMessage then botConfig.ActionDetectedTopicId
490
+
else botConfig.ActionPotentialTopicId
491
+
492
+
// Phase 1: Create callback(s) without message_id
493
+
// For detected spam: one NotASpam callback
494
+
// For potential spam: two callbacks - Spam (KILL) and NotASpam (NOT SPAM)
495
+
let!callbackIds,markup =task{
489
496
if deleteMessage then
490
-
// Detected spam → Detected topic with NOT A SPAM button
491
-
botConfig.ActionDetectedTopicId,
492
-
fun(callbackId: Guid)-> InlineKeyboardMarkup [
493
-
InlineKeyboardButton.WithCallbackData("✅ NOT a spam", string callbackId)
0 commit comments