Skip to content

True-up the invites module #2226

@null-domain

Description

@null-domain

Noticed a few discrepancies while working on #2212 / #2224 -

  • invites.Invite is missing an enum field for all the possible invite types.
  • While not officially documented other than the 'Friend' invite type, invites that point directly to a user are supported.
    • This raises the issue of invites not having either a guild(_id) or a channel(_id) associated with them, as the Invite class hints that guild, guild_id, and channel can be None but not channel_id. The channel field in an Invite response object is described as being nullable
    • These friend-specific invites look like this (note the null channel and type: 2)
      {
        "code": "<invitecode>",
        "inviter": { < inviter user object > },
        "channel": null,
        "type": 2,
        "uses": 0,
        "max_uses": 5,
        "max_age": 604800,
        "created_at": "2025-03-19T11:40:31.885200+00:00",
        "expires_at": "2025-03-26T11:40:31+00:00"
      }
      
      Image
    • The max_uses is always set to 5, and max_age is always 7 days/expires_at is always created_at + 7 days
  • guild_scheduled_event(_id) is also listed as a possible (nullable) field on an Invite object, but it's missing from invites.Invite and should be added

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions