From bfcdeb4634a9f0daab5e7229f1ce11e61e5889f6 Mon Sep 17 00:00:00 2001 From: Nonoo Date: Tue, 15 Aug 2023 11:30:54 +0200 Subject: [PATCH] Only reply to an invalid command if it came from a private chat --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 52188f6..963c6e6 100644 --- a/main.go +++ b/main.go @@ -92,7 +92,9 @@ func handleMsg(ctx context.Context, entities tg.Entities, u *tg.UpdateNewMessage return nil default: 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 } }