Allow curly braces in place of square brackets

This commit is contained in:
Holly McFarland 2022-01-29 19:47:10 -05:00
parent a95e1fb029
commit 07d80f689a
1 changed files with 8 additions and 1 deletions

View File

@ -235,7 +235,14 @@ async def handle_status(c, status):
media_ids = None media_ids = None
try: try:
card_names = re.findall(r'\[\[(.*?)\]\]', status_text) card_names = re.findall(
r'''
(?:\[\[|\{\{) # A non-capturing group of the characters "[[" or "{{"
(.*?) # The card text being searched for (in a capturing group, so it's returned alone)
(?:\]\]|\}\}) # A non-capturing group of the characters "]]" or "}}"
''',
status_text,
re.VERBOSE)
# ignore any statuses without cards in them # ignore any statuses without cards in them
if not card_names: return if not card_names: return