mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Fix Deprecation warning due to invalid escape sequences
This commit is contained in:
parent
57fb8d2fad
commit
ef81868ebc
@ -244,7 +244,7 @@ def extract_arguments(text):
|
|||||||
:param text: String to extract the arguments from a command
|
:param text: String to extract the arguments from a command
|
||||||
:return: the arguments if `text` is a command (according to is_command), else None.
|
:return: the arguments if `text` is a command (according to is_command), else None.
|
||||||
"""
|
"""
|
||||||
regexp = re.compile("/\w*(@\w*)*\s*([\s\S]*)",re.IGNORECASE)
|
regexp = re.compile(r"/\w*(@\w*)*\s*([\s\S]*)",re.IGNORECASE)
|
||||||
result = regexp.match(text)
|
result = regexp.match(text)
|
||||||
return result.group(2) if is_command(text) else None
|
return result.group(2) if is_command(text) else None
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class TestTeleBot:
|
|||||||
bot = telebot.TeleBot('')
|
bot = telebot.TeleBot('')
|
||||||
msg = self.create_text_message(r'https://web.telegram.org/')
|
msg = self.create_text_message(r'https://web.telegram.org/')
|
||||||
|
|
||||||
@bot.message_handler(regexp='((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)')
|
@bot.message_handler(regexp=r'((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)')
|
||||||
def command_url(message):
|
def command_url(message):
|
||||||
msg.text = 'got'
|
msg.text = 'got'
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class TestTeleBot:
|
|||||||
bot = telebot.TeleBot('')
|
bot = telebot.TeleBot('')
|
||||||
msg = self.create_text_message(r'web.telegram.org/')
|
msg = self.create_text_message(r'web.telegram.org/')
|
||||||
|
|
||||||
@bot.message_handler(regexp='((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)')
|
@bot.message_handler(regexp=r'((https?):((//)|(\\\\))+([\w\d:#@%/;$()~_?\+-=\\\.&](#!)?)*)')
|
||||||
def command_url(message):
|
def command_url(message):
|
||||||
msg.text = 'got'
|
msg.text = 'got'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user