sidequest_common.models.role_resets#
Discord role-reset outbox: a site account was deleted and must be stripped of every manageable Discord role.
Classes#
One Discord user who deleted their site account and still needs their Discord roles stripped. |
Module Contents#
- class sidequest_common.models.role_resets.MemberRoleReset#
Bases:
advanced_alchemy.base.UUIDAuditBaseOne Discord user who deleted their site account and still needs their Discord roles stripped.
Written by
MembersService.delete_accountin the same transaction as the account deletion, so the outbox row survives even though theMemberrow it’s about is gone. The bot’slink_rolesplugin removes every role it can manage fromdiscord_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 viaPOST .../role-resets/{id}/ack, which setsdone_at. A member no longer in the guild is acked as done without any role changes.requested_atorders 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.- discord_id: sqlalchemy.orm.Mapped[int]#
- done_at: sqlalchemy.orm.Mapped[datetime.datetime | None]#
- requested_at: sqlalchemy.orm.Mapped[datetime.datetime]#