Fix "not an url" for groups

This commit is contained in:
Pavel Mezhuev 2024-08-14 00:48:40 +03:00 committed by GitHub
parent 2b3658ceed
commit a1c66784d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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":