From 20048736eb8357200ed85e87df800777c429c4f7 Mon Sep 17 00:00:00 2001 From: Astra Date: Mon, 16 Mar 2026 16:20:54 +0100 Subject: [PATCH] Update contact regex, fix login --- bot.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.go b/bot.go index 5e35618..33e0107 100644 --- a/bot.go +++ b/bot.go @@ -138,7 +138,7 @@ var scamPatterns = []scamPattern{ }, { name: "contact", - re: regexp.MustCompile(`(?i)(?:\bdm\b|(send|write).*(?:private)?\s+.?\+.?|get\s+in\s+touch)|@\w+`), + re: regexp.MustCompile(`((?i)(?:\bdm\b|(send|write).*\bprivate\b|get\s+in\s+touch)|@\w+)`), weight: 0.5, }, { @@ -476,8 +476,8 @@ func main() { err = client.Run(ctx, func(ctx context.Context) error { // Check if session exists; if not, authenticate - _, err := os.Stat(cfg.SessionPath) - if err != nil { + info, _ := os.Stat(cfg.SessionPath) + if info.Size() == 0 { // Session doesn't exist, prompt for credentials fmt.Print("Enter phone number: ") var phone string