Only reply to an invalid command if it came from a private chat

This commit is contained in:
Nonoo 2023-08-15 11:30:54 +02:00
parent 103079a2fb
commit bfcdeb4634

View File

@ -92,7 +92,9 @@ func handleMsg(ctx context.Context, entities tg.Entities, u *tg.UpdateNewMessage
return nil return nil
default: default:
fmt.Println(" (invalid cmd)") fmt.Println(" (invalid cmd)")
_, _ = telegramSender.Reply(entities, u).Text(ctx, errorStr+": invalid command") if fromGroup != nil {
_, _ = telegramSender.Reply(entities, u).Text(ctx, errorStr+": invalid command")
}
return nil return nil
} }
} }