[go: up one dir, main page]

Skip to content

Temporary restrictions: serialization error

Sophie Version

73764dc5

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

modules/restrictions.py:

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}
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information