added around kwarg to message_gen

This commit is contained in:
jsl12
2022-05-19 21:04:06 -05:00
parent 477836bde2
commit c292435ade

View File

@@ -14,15 +14,20 @@ async def message_gen(client: Client,
before: datetime = None,
days: int = None,
after: datetime = None,
around: datetime = None,
oldest_first: bool = True) -> AsyncIterator[Message]:
if days is not None:
after = (datetime.today() - timedelta(days=days)).astimezone()
if around is not None and limit > 100:
limit = 100
kwargs = {
'limit': limit,
'before': before,
'after': after,
'oldest_first': oldest_first
'oldest_first': oldest_first,
'around': around
}
LOGGER.info(kwargs)