hikari.invites#
Application and entities that are used to describe invites on Discord.
Module Contents#
- class hikari.invites.Invite[source]#
Bases:
InviteCode
Represents an invite that’s used to add users to a guild or group dm.
- app: hikari.traits.RESTAware[source]#
Client application that models may use for procedures.
- approximate_active_member_count: Optional[int][source]#
The approximate amount of presences in this invite’s guild.
This is only returned by the GET REST Invites endpoint.
- approximate_member_count: Optional[int][source]#
The approximate amount of members in this invite’s guild.
This is only returned by the GET Invites REST endpoint.
- channel: Optional[hikari.channels.PartialChannel][source]#
The partial object of the channel this invite targets.
Will be
None
for invite objects that are attached to gateway events, in which case you should refer toInvite.channel_id
.
- channel_id: hikari.snowflakes.Snowflake[source]#
The ID of the channel this invite targets.
- expires_at: Optional[datetime.datetime][source]#
When this invite will expire.
This field is only returned by the GET Invite REST endpoint and will be returned as
None
by said endpoint if the invite doesn’t have a set expiry date. Other places will always return this asNone
.
- guild: Optional[InviteGuild][source]#
The partial object of the guild this invite belongs to.
Will be
None
for group DM invites and when attached to a gateway event; for invites received over the gateway you should refer toInvite.guild_id
.
- guild_id: Optional[hikari.snowflakes.Snowflake][source]#
The ID of the guild this invite belongs to.
Will be
None
for group DM invites.
- inviter: Optional[hikari.users.User][source]#
The object of the user who created this invite.
- target_application: Optional[hikari.applications.InviteApplication][source]#
The embedded application this invite targets, if applicable.
- target_type: Union[TargetType, int, None][source]#
The type of the target of this invite, if applicable.
- target_user: Optional[hikari.users.User][source]#
The object of the user who this invite targets, if set.
- class hikari.invites.InviteGuild[source]#
Bases:
hikari.guilds.PartialGuild
Represents the partial data of a guild that is attached to invites.
- property banner_url: Optional[hikari.files.URL][source]#
Banner URL for the guild, if set.
- property splash_url: Optional[hikari.files.URL][source]#
Splash URL for the guild, if set.
- banner_hash: Optional[str][source]#
The hash for the guild’s banner.
This is only present if
hikari.guilds.GuildFeature.BANNER
is in thefeatures
for this guild. For all other purposes, it isNone
.
- description: Optional[str][source]#
The guild’s description.
This is only present if certain
features
are set in this guild. Otherwise, this will always beNone
. For all other purposes, it isNone
.
- features: Sequence[Union[str, hikari.guilds.GuildFeature]][source]#
A list of the features in this guild.
- nsfw_level: hikari.guilds.GuildNSFWLevel[source]#
The NSFW level of the guild.
- vanity_url_code: Optional[str][source]#
The vanity URL code for the guild’s vanity URL.
This is only present if
hikari.guilds.GuildFeature.VANITY_URL
is in thefeatures
for this guild. If not, this will always beNone
.
- verification_level: Union[hikari.guilds.GuildVerificationLevel, int][source]#
The verification level required for a user to participate in this guild.
- welcome_screen: Optional[hikari.guilds.WelcomeScreen][source]#
The welcome screen of a community guild shown to new members, if set.
- make_banner_url(*, ext=None, size=4096)[source]#
Generate the guild’s banner image URL, if set.
- Parameters:
- ext
typing.Optional
[str
] The ext to use for this URL, defaults to
png
orgif
. Supportspng
,jpeg
,jpg
,webp
andgif
(when animated).If
None
, then the correct default extension is determined based on whether the banner is animated or not.- size
int
The size to set for the URL, defaults to
4096
. Can be any power of two between 16 and 4096.
- ext
- Returns:
typing.Optional
[hikari.files.URL
]The URL of the banner, or
None
if no banner is set.
- Raises:
ValueError
If
size
is not a power of two or not between 16 and 4096.
- make_splash_url(*, ext='png', size=4096)[source]#
Generate the guild’s splash image URL, if set.
- Parameters:
- Returns:
typing.Optional
[hikari.files.URL
]The URL to the splash, or
None
if not set.
- Raises:
ValueError
If
size
is not a power of two or not between 16 and 4096.
- class hikari.invites.InviteWithMetadata[source]#
Bases:
Invite
Extends the base
Invite
object with metadata.The metadata is only returned when getting an invite with guild permissions, rather than it’s code.
- property uses_left: Optional[int][source]#
Return the number of uses left for this invite.
This will be
None
if the invite has unlimited uses.
- created_at: datetime.datetime[source]#
When this invite was created.
- expires_at: Optional[datetime.datetime][source]#
When this invite will expire.
If this invite doesn’t have a set expiry then this will be
None
.
- max_age: Optional[datetime.timedelta][source]#
The timedelta of how long this invite will be valid for.
If set to
None
then this is unlimited.
- class hikari.invites.TargetType[source]#
Bases:
int
,hikari.internal.enums.Enum
The target of the invite.
- class hikari.invites.VanityURL[source]#
Bases:
InviteCode
A special case invite object, that represents a guild’s vanity url.
- app: hikari.traits.RESTAware[source]#
Client application that models may use for procedures.