Temporary restrictions: serialization error
Sophie Version
To Reproduce
/tmute user 1m
Actual behaviour
Sorry, I encountered a error!
TypeError: datetime.timedelta(seconds=60) is not JSON serializable
User not restricted.
Expected behaviour
User restricted.
Additional info
await mute_user(chat_id, user_id, until_date=until_date)
# until_date=datetime.timedelta(seconds=60)
modules/utils/restrictions.py:
async def mute_user(chat_id, user_id, until_date=None):
await bot.restrict_chat_member(
# aiogram.bot.bot.Bot.restrict_chat_member(...)
# which calls json.dump over {'can_send_messages': False, 'until_date': until_date}