fixes wrong url parse from message
This commit is contained in:
parent
60365973d8
commit
f8b1cb6d48
1 changed files with 5 additions and 3 deletions
|
@ -64,9 +64,11 @@ func containsURL(msg *gotgbot.Message) bool {
|
|||
|
||||
func getMessageURL(msg *gotgbot.Message) string {
|
||||
for _, entity := range msg.Entities {
|
||||
if entity.Type == "url" {
|
||||
return msg.Text[entity.Offset : entity.Offset+entity.Length]
|
||||
}
|
||||
parsedEntity := gotgbot.ParseEntity(
|
||||
msg.Text,
|
||||
entity,
|
||||
)
|
||||
return parsedEntity.Text
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue