Update contact regex, fix login

This commit is contained in:
Astra 2026-03-16 16:20:54 +01:00
parent d9f71f1a3f
commit 20048736eb

6
bot.go
View file

@ -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