mirror of
https://github.com/Rongronggg9/SlashBot.git
synced 2025-02-06 09:13:29 +08:00
adjust regex
This commit is contained in:
parent
39d768b9d5
commit
cecd2f70d8
@ -3,7 +3,7 @@ import re
|
||||
from telegram.ext import Updater, MessageHandler, filters
|
||||
|
||||
Filters = filters.Filters
|
||||
parser = re.compile(r'^\/(\S+)([ ]*)(\S*)(.*)$')
|
||||
parser = re.compile(r'^\/(\S+)([ ]*)(.*)$')
|
||||
|
||||
# Docker env
|
||||
if os.environ.get('TOKEN') and os.environ['TOKEN'] != 'X':
|
||||
@ -21,7 +21,7 @@ def mention(user):
|
||||
|
||||
|
||||
def get_text(mention_from, mention_rpl, command):
|
||||
parsed = [delUsername.sub('', p) for p in parser.search(command).groups()]
|
||||
parsed = parser.search(delUsername.sub('', command)).groups()
|
||||
if parsed[2]:
|
||||
return f"{mention_from} {parsed[0]} {mention_rpl} {parsed[2]}!"
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user