hikari.invites
#
Application and entities that are used to describe invites on Discord.
Invite #
Bases: InviteCode
Represents an invite that's used to add users to a guild or group dm.
app class-attribute
instance-attribute
#
Client application that models may use for procedures.
approximate_active_member_count class-attribute
instance-attribute
#
The approximate amount of presences in this invite's guild.
This is only returned by the GET REST Invites endpoint.
approximate_member_count class-attribute
instance-attribute
#
The approximate amount of members in this invite's guild.
This is only returned by the GET Invites REST endpoint.
channel class-attribute
instance-attribute
#
channel: Optional[PartialChannel] = field(eq=False, hash=False, repr=False)
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 to hikari.invites.Invite.channel_id
.
channel_id class-attribute
instance-attribute
#
The ID of the channel this invite targets.
code class-attribute
instance-attribute
#
The code for this invite.
expires_at class-attribute
instance-attribute
#
guild class-attribute
instance-attribute
#
guild: Optional[InviteGuild] = field(eq=False, hash=False, repr=False)
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 to hikari.invites.Invite.guild_id
.
guild_id class-attribute
instance-attribute
#
The ID of the guild this invite belongs to.
Will be None
for group DM invites.
inviter class-attribute
instance-attribute
#
The object of the user who created this invite.
target_application class-attribute
instance-attribute
#
target_application: Optional[InviteApplication] = field(eq=False, hash=False, repr=False)
The embedded application this invite targets, if applicable.
target_type class-attribute
instance-attribute
#
target_type: Union[TargetType, int, None] = field(eq=False, hash=False, repr=False)
The type of the target of this invite, if applicable.
InviteCode #
InviteGuild #
Bases: PartialGuild
Represents the partial data of a guild that is attached to invites.
banner_hash class-attribute
instance-attribute
#
The hash for the guild's banner.
This is only present if hikari.guilds.GuildFeature.BANNER
is in the features
for this guild. For all other purposes, it is None
.
description class-attribute
instance-attribute
#
The guild's description.
features class-attribute
instance-attribute
#
features: Sequence[Union[str, GuildFeature]] = field(eq=False, hash=False, repr=False)
A list of the features in this guild.
nsfw_level class-attribute
instance-attribute
#
nsfw_level: GuildNSFWLevel = field(eq=False, hash=False, repr=False)
The NSFW level of the guild.
splash_hash class-attribute
instance-attribute
#
The hash of the splash for the guild, if there is one.
vanity_url_code class-attribute
instance-attribute
#
The vanity URL code for the guild's vanity URL.
This is only present if hikari.guilds.GuildFeature.VANITY_URL
is in the features
for this guild. If not, this will always be None
.
verification_level class-attribute
instance-attribute
#
verification_level: Union[GuildVerificationLevel, int] = field(eq=False, hash=False, repr=False)
The verification level required for a user to participate in this guild.
welcome_screen class-attribute
instance-attribute
#
welcome_screen: Optional[WelcomeScreen] = field(eq=False, hash=False, repr=False)
The welcome screen of a community guild shown to new members, if set.
make_banner_url #
Generate the guild's banner image URL, if set.
PARAMETER | DESCRIPTION |
---|---|
ext | The ext to use for this URL. Supports If |
size | The size to set for the URL. Can be any power of two between TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[URL] | The URL of the banner, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If |
make_splash_url #
Generate the guild's splash image URL, if set.
PARAMETER | DESCRIPTION |
---|---|
ext | The extension to use for this URL. supports TYPE: |
size | The size to set for the URL. Can be any power of two between TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[URL] | The URL to the splash, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If |
InviteWithMetadata #
Bases: Invite
Extends the base hikari.invites.Invite
object with metadata.
The metadata is only returned when getting an invite with guild permissions, rather than it's code.
created_at class-attribute
instance-attribute
#
When this invite was created.
expires_at instance-attribute
#
When this invite will expire.
If this invite doesn't have a set expiry then this will be None
.
is_temporary class-attribute
instance-attribute
#
Whether this invite grants temporary membership.
max_age class-attribute
instance-attribute
#
The timedelta of how long this invite will be valid for.
If set to None
then this is unlimited.
max_uses class-attribute
instance-attribute
#
The limit for how many times this invite can be used before it expires.
If set to None
then this is unlimited.
uses class-attribute
instance-attribute
#
The amount of times this invite has been used.
TargetType #
VanityURL #
Bases: InviteCode
A special case invite object, that represents a guild's vanity url.