Merge pull request #14 from pmezhuev/patch-2

Fix "not an url" for groups
This commit is contained in:
Norbert Varga
2024-08-16 07:52:23 +03:00
committed by GitHub
+1 -1
View File
@@ -88,10 +88,10 @@ func handleMsg(ctx context.Context, entities tg.Entities, u *tg.UpdateNewMessage
// Check if message is a command.
if msg.Message[0] == '/' || msg.Message[0] == '!' {
cmd := strings.Split(msg.Message, " ")[0]
msg.Message = strings.TrimPrefix(msg.Message, cmd+" ")
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":