From d5b81a3b5a42f0f4f86f6bb69354d8f14adb7eb8 Mon Sep 17 00:00:00 2001 From: Nonoo Date: Tue, 22 Aug 2023 10:30:40 +0200 Subject: [PATCH] Add support for ! cmd char --- main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index edf1734..52310c5 100644 --- a/main.go +++ b/main.go @@ -77,20 +77,21 @@ func handleMsg(ctx context.Context, entities tg.Entities, u *tg.UpdateNewMessage } // Check if message is a command. - if msg.Message[0] == '/' { + if msg.Message[0] == '/' || msg.Message[0] == '!' { cmd := strings.Split(msg.Message, " ")[0] if strings.Contains(cmd, "@") { cmd = strings.Split(cmd, "@")[0] } msg.Message = strings.TrimPrefix(msg.Message, cmd+" ") + cmd = cmd[1:] // Cutting the command character. switch cmd { - case "/dlp": + case "dlp": handleCmdDLP(ctx, entities, u, msg) return nil - case "/dlpcancel": + case "dlpcancel": handleCmdDLPCancel(ctx, entities, u, msg) return nil - case "/start": + case "start": fmt.Println(" (start cmd)") if fromGroup == nil { _, _ = telegramSender.Reply(entities, u).Text(ctx, "🤖 Welcome! This bot downloads videos from various "+