From ee6ad5660477743ba8ee50f51f2a3a2550acfa9c Mon Sep 17 00:00:00 2001 From: slice Date: Sat, 1 Sep 2018 19:23:13 -0700 Subject: [PATCH] Revert "refactor out _dummy function" This reverts commit 24a19c873651a7879cc46946d8130d335b6b7c1c. --- litecord/storage.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/litecord/storage.py b/litecord/storage.py index 6ddb70c..c608288 100644 --- a/litecord/storage.py +++ b/litecord/storage.py @@ -4,6 +4,10 @@ from .enums import ChannelType from .schemas import USER_MENTION, ROLE_MENTION +async def _dummy(any_id): + return str(any_id) + + class Storage: """Class for common SQL statements.""" def __init__(self, db): @@ -339,9 +343,9 @@ class Storage: res['mentions'] = await self._msg_regex(USER_MENTION, self.get_user, row['content']) - # we just return the id as a string, since we don't actually use the role - # objects in mention_roles, just their ids. - res['mention_roles'] = await self._msg_regex(ROLE_MENTION, str, + # _dummy just returns the string of the id, since we don't + # actually use the role objects in mention_roles, just their ids. + res['mention_roles'] = await self._msg_regex(ROLE_MENTION, _dummy, row['content']) # TODO: handle webhook authors