Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
First option
if message.text.split('http://', maxsplit = 1)[0] == '': #do
something.
Like, if at the beginning of the line something like "http" "https", do something, but this is not for all cases ...
The second option.
import requests
if requests.get(message.text).status_code == 200:
3. It may not be in the text of the message, but in the "entities" of the "message" object.message.entities[0].url
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question