sidequest_common.models.role_resets =================================== .. py:module:: sidequest_common.models.role_resets .. autoapi-nested-parse:: Discord role-reset outbox: a site account was deleted and must be stripped of every manageable Discord role. Classes ------- .. autoapisummary:: sidequest_common.models.role_resets.MemberRoleReset Module Contents --------------- .. py:class:: MemberRoleReset Bases: :py:obj:`advanced_alchemy.base.UUIDAuditBase` One Discord user who deleted their site account and still needs their Discord roles stripped. Written by ``MembersService.delete_account`` in the same transaction as the account deletion, so the outbox row survives even though the ``Member`` row it's about is gone. The bot's ``link_roles`` plugin removes every role it can manage from ``discord_id`` (keeping ``@everyone``, managed/integration roles, and anything at or above its own top role, which Discord would reject anyway) and immediately re-grants the gate role, since the member is now unlinked; it then acks via ``POST .../role-resets/{id}/ack``, which sets ``done_at``. A member no longer in the guild is acked as done without any role changes. ``requested_at`` orders the outbox oldest-first; rows that go unacked past the API's retention window (e.g. the member left before the bot could act) are dropped by the listing route rather than sitting forever. .. py:attribute:: discord_id :type: sqlalchemy.orm.Mapped[int] .. py:attribute:: done_at :type: sqlalchemy.orm.Mapped[datetime.datetime | None] .. py:attribute:: requested_at :type: sqlalchemy.orm.Mapped[datetime.datetime]