sidequest_common.schemas.levels =============================== .. py:module:: sidequest_common.schemas.levels .. autoapi-nested-parse:: Leveling schemas. Attributes ---------- .. autoapisummary:: sidequest_common.schemas.levels.MAX_XP Classes ------- .. autoapisummary:: sidequest_common.schemas.levels.LeaderboardEntry sidequest_common.schemas.levels.LeaderboardPage sidequest_common.schemas.levels.LevelRoleSchema sidequest_common.schemas.levels.LevelRoleUpsert sidequest_common.schemas.levels.MemberLevelSchema sidequest_common.schemas.levels.RankSchema sidequest_common.schemas.levels.SetXPRequest sidequest_common.schemas.levels.XPAwardResult Module Contents --------------- .. py:class:: LeaderboardEntry Bases: :py:obj:`pydantic.BaseModel` One leaderboard row. .. py:attribute:: level :type: int .. py:attribute:: message_count :type: int .. py:attribute:: rank :type: int .. py:attribute:: user_id :type: int .. py:attribute:: xp :type: int .. py:class:: LeaderboardPage Bases: :py:obj:`pydantic.BaseModel` A page of the leaderboard, highest XP first. .. py:attribute:: entries :type: list[LeaderboardEntry] .. py:attribute:: limit :type: int .. py:attribute:: offset :type: int .. py:attribute:: total :type: int .. py:class:: LevelRoleSchema Bases: :py:obj:`pydantic.BaseModel` Role rewarded at a level. .. py:attribute:: level :type: int .. py:attribute:: model_config .. py:attribute:: role_id :type: int .. py:class:: LevelRoleUpsert Bases: :py:obj:`pydantic.BaseModel` Body for ``PUT /level-roles/{level}``. .. py:attribute:: role_id :type: int .. py:class:: MemberLevelSchema Bases: :py:obj:`pydantic.BaseModel` Raw stored level row. .. py:attribute:: guild_id :type: int .. py:attribute:: level :type: int .. py:attribute:: message_count :type: int .. py:attribute:: model_config .. py:attribute:: user_id :type: int .. py:attribute:: xp :type: int .. py:class:: RankSchema Bases: :py:obj:`pydantic.BaseModel` A member's standing. ``rank`` is 1-based position by XP, or None if they have no XP yet. .. py:attribute:: level :type: int .. py:attribute:: message_count :type: int .. py:attribute:: rank :type: int | None .. py:attribute:: user_id :type: int .. py:attribute:: xp :type: int .. py:attribute:: xp_for_next_level :type: int .. py:attribute:: xp_into_level :type: int .. py:class:: SetXPRequest Bases: :py:obj:`pydantic.BaseModel` Admin override of a member's XP total (level is recomputed). .. py:attribute:: xp :type: int .. py:class:: XPAwardResult Bases: :py:obj:`pydantic.BaseModel` Outcome of ``POST /members/{user_id}/xp`` (one chat message's worth of XP). ``awarded`` is False while the member is on cooldown (or leveling is disabled); every other field then reflects the unchanged totals. ``earned_role_ids`` are level-role rewards for every level crossed by this award; ``remove_role_ids`` are lower level-roles to take away when the guild has ``level_roles_stack=False``. .. py:attribute:: amount :type: int .. py:attribute:: awarded :type: bool .. py:attribute:: earned_role_ids :type: list[int] .. py:attribute:: level :type: int .. py:attribute:: leveled_up :type: bool .. py:attribute:: previous_level :type: int .. py:attribute:: remove_role_ids :type: list[int] .. py:attribute:: xp :type: int .. py:data:: MAX_XP :value: 10000000000 Ceiling for admin XP overrides (~level 1800); keeps the level calculation bounded and fits a BIGINT.