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
commit f2c9c4e388
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. // Check if message is a command.
if msg.Message[0] == '/' || msg.Message[0] == '!' { if msg.Message[0] == '/' || msg.Message[0] == '!' {
cmd := strings.Split(msg.Message, " ")[0] cmd := strings.Split(msg.Message, " ")[0]
msg.Message = strings.TrimPrefix(msg.Message, cmd+" ")
if strings.Contains(cmd, "@") { if strings.Contains(cmd, "@") {
cmd = strings.Split(cmd, "@")[0] cmd = strings.Split(cmd, "@")[0]
} }
msg.Message = strings.TrimPrefix(msg.Message, cmd+" ")
cmd = cmd[1:] // Cutting the command character. cmd = cmd[1:] // Cutting the command character.
switch cmd { switch cmd {
case "dlp": case "dlp":