hikari.guilds
#
Application and entities that are used to describe guilds on Discord.
GatewayGuild #
Bases: Guild
Guild specialization that is sent via the gateway only.
is_large class-attribute
instance-attribute
#
Whether the guild is considered to be large or not.
This information is only available if the guild was sent via a GUILD_CREATE
event. If the guild is received from any other place, this will always be None
.
The implications of a large guild are that presence information will not be sent about members who are offline or invisible.
joined_at class-attribute
instance-attribute
#
The date and time that the bot user joined this guild.
This information is only available if the guild was sent via a GUILD_CREATE
event. If the guild is received from any other place, this will always be None
.
Guild #
Bases: PartialGuild
A representation of a guild on Discord.
afk_channel_id class-attribute
instance-attribute
#
The ID for the channel that AFK voice users get sent to.
If None
, then no AFK channel is set up for this guild.
afk_timeout class-attribute
instance-attribute
#
Timeout for activity before a member is classed as AFK.
How long a voice user has to be AFK for before they are classed as being AFK and are moved to the AFK channel (hikari.guilds.Guild.afk_channel_id
).
application_id class-attribute
instance-attribute
#
The ID of the application that created this guild.
This will always be None
for guilds that weren't created by a bot.
banner_hash class-attribute
instance-attribute
#
The hash for the guild's banner.
This is only present if the guild has hikari.guilds.GuildFeature.BANNER
in hikari.guilds.Guild.features
for this guild. For all other purposes, it is None
.
default_message_notifications class-attribute
instance-attribute
#
default_message_notifications: Union[GuildMessageNotificationsLevel, int] = field(eq=False, hash=False, repr=False)
The default setting for message notifications in this guild.
description class-attribute
instance-attribute
#
The guild's description.
This is only present if certain hikari.guilds.GuildFeature
's are set in hikari.guilds.Guild.features
for this guild. Otherwise, this will always be None
.
discovery_splash_hash class-attribute
instance-attribute
#
The hash of the discovery splash for the guild, if there is one.
discovery_splash_url property
#
Discovery splash URL for the guild, if set.
explicit_content_filter class-attribute
instance-attribute
#
explicit_content_filter: Union[GuildExplicitContentFilterLevel, int] = field(eq=False, hash=False, repr=False)
The setting for the explicit content filter in this guild.
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.
is_widget_enabled class-attribute
instance-attribute
#
Describes whether the guild widget is enabled or not.
If this information is not present, this will be None
.
max_video_channel_users class-attribute
instance-attribute
#
The maximum number of users allowed in a video channel together.
This information may not be present, in which case, it will be None
.
mfa_level class-attribute
instance-attribute
#
mfa_level: Union[GuildMFALevel, int] = field(eq=False, hash=False, repr=False)
The required MFA level for users wishing to participate 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.
owner_id class-attribute
instance-attribute
#
The ID of the owner of this guild.
preferred_locale class-attribute
instance-attribute
#
The preferred locale to use for this guild.
This can only be change if hikari.guilds.GuildFeature.COMMUNITY
is in hikari.guilds.Guild.features
for this guild and will otherwise default to en-US
.
premium_subscription_count class-attribute
instance-attribute
#
The number of nitro boosts that the server currently has.
This information may not be present, in which case, it will be None
.
premium_tier class-attribute
instance-attribute
#
premium_tier: Union[GuildPremiumTier, int] = field(eq=False, hash=False, repr=False)
The premium tier for this guild.
public_updates_channel_id class-attribute
instance-attribute
#
The channel ID of the channel where admins and moderators receive notices from Discord.
This is only present if hikari.guilds.GuildFeature.COMMUNITY
is in hikari.guilds.Guild.features
for this guild. For all other purposes, it should be considered to be None
.
rules_channel_id class-attribute
instance-attribute
#
The ID of the channel where rules and guidelines will be displayed.
If the hikari.guilds.GuildFeature.COMMUNITY
feature is not defined, then this is None
.
splash_hash class-attribute
instance-attribute
#
The hash of the splash for the guild, if there is one.
system_channel_flags class-attribute
instance-attribute
#
system_channel_flags: GuildSystemChannelFlag = field(eq=False, hash=False, repr=False)
Return flags for the guild system channel.
These are used to describe which notifications are suppressed.
system_channel_id class-attribute
instance-attribute
#
The ID of the system channel or None
if it is not enabled.
Welcome messages and Nitro boost messages may be sent to this channel.
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 hikari.guilds.Guild.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 needed for a user to participate in this guild.
widget_channel_id class-attribute
instance-attribute
#
The channel ID that the widget's generated invite will send the user to.
If this information is unavailable or this is not enabled for the guild then this will be None
.
fetch_afk_channel async
#
fetch_afk_channel() -> Optional[GuildVoiceChannel]
Fetch the channel that AFK voice users get sent to.
RETURNS | DESCRIPTION |
---|---|
Optional[GuildVoiceChannel] | The AFK channel or |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_owner async
#
fetch_owner() -> Member
Fetch the owner of the guild.
RETURNS | DESCRIPTION |
---|---|
Member | The guild owner. |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or the user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_public_updates_channel async
#
fetch_public_updates_channel() -> Optional[GuildTextChannel]
Fetch channel ID of the channel where admins and moderators receive notices from Discord.
This is only present if hikari.guilds.GuildFeature.COMMUNITY
is in hikari.guilds.Guild.features
for this guild. For all other purposes, it should be considered to be None
.
RETURNS | DESCRIPTION |
---|---|
Optional[GuildTextChannel] | The channel where discord sends relevant updates to moderators and admins. |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_rules_channel async
#
fetch_rules_channel() -> Optional[GuildTextChannel]
Fetch the channel where guilds display rules and guidelines.
If the hikari.guilds.GuildFeature.COMMUNITY
feature is not defined, then this is None
.
RETURNS | DESCRIPTION |
---|---|
Optional[GuildTextChannel] | The channel where the rules of the guild are specified or else |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_system_channel async
#
fetch_system_channel() -> Optional[GuildTextChannel]
Fetch the system channel.
RETURNS | DESCRIPTION |
---|---|
Optional[GuildTextChannel] | The system channel for this guild or |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_widget_channel async
#
fetch_widget_channel() -> Optional[GuildChannel]
Fetch the widget channel.
This will be None
if not set.
RETURNS | DESCRIPTION |
---|---|
Optional[GuildChannel] | The channel the widget is linked to or else |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
get_channel #
get_channel(channel: SnowflakeishOr[PartialChannel]) -> Optional[PermissibleGuildChannel]
Get a cached channel that belongs to the guild by it's ID or object.
PARAMETER | DESCRIPTION |
---|---|
channel | The object or ID of the guild channel to get from the cache. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[GuildChannel] | The object of the guild channel found in cache or |
get_channels #
get_channels() -> Mapping[Snowflake, PermissibleGuildChannel]
Get the channels cached for the guild.
RETURNS | DESCRIPTION |
---|---|
Mapping[Snowflake, GuildChannel] | A mapping of channel IDs to objects of the channels cached for the guild. |
get_emoji #
get_emoji(emoji: SnowflakeishOr[CustomEmoji]) -> Optional[KnownCustomEmoji]
Get a cached emoji that belongs to the guild by it's ID or object.
PARAMETER | DESCRIPTION |
---|---|
emoji | The object or ID of the emoji to get from the cache. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[KnownCustomEmoji] | The object of the custom emoji if found in cache, else |
get_emojis #
get_emojis() -> Mapping[Snowflake, KnownCustomEmoji]
Return the emojis in this guild.
RETURNS | DESCRIPTION |
---|---|
Mapping[Snowflake, KnownCustomEmoji] | A mapping of emoji IDs to the objects of emojis in this guild. |
get_member #
get_member(user: SnowflakeishOr[PartialUser]) -> Optional[Member]
Get a cached member that belongs to the guild by it's user ID or object.
PARAMETER | DESCRIPTION |
---|---|
user | The object or ID of the user to get the cached member for. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[Member] | The cached member object if found, else |
get_members #
get_my_member #
get_presence #
get_presence(user: SnowflakeishOr[PartialUser]) -> Optional[MemberPresence]
Get a cached presence that belongs to the guild by it's user ID or object.
PARAMETER | DESCRIPTION |
---|---|
user | The object or ID of the user to get the cached presence for. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[MemberPresence] | The cached presence object if found, else |
get_presences #
get_presences() -> Mapping[Snowflake, MemberPresence]
Get the presences cached for the guild.
RETURNS | DESCRIPTION |
---|---|
Mapping[Snowflake, MemberPresence] | A mapping of user IDs to objects of the presences cached for the guild. |
get_role #
get_role(role: SnowflakeishOr[PartialRole]) -> Optional[Role]
Get a cached role that belongs to the guild by it's ID or object.
PARAMETER | DESCRIPTION |
---|---|
role | The object or ID of the role to get for this guild from the cache. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[Role] | The object of the role found in cache, else |
get_roles #
get_sticker #
get_sticker(sticker: SnowflakeishOr[GuildSticker]) -> Optional[GuildSticker]
Get a cached sticker that belongs to the guild by it's ID or object.
PARAMETER | DESCRIPTION |
---|---|
sticker | The object or ID of the sticker to get from the cache. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[GuildSticker] | The object of the sticker if found in cache, else |
get_stickers #
get_stickers() -> Mapping[Snowflake, GuildSticker]
Return the stickers in this guild.
RETURNS | DESCRIPTION |
---|---|
Mapping[Snowflake, GuildSticker] | A mapping of sticker IDs to the objects of sticker in this guild. |
get_voice_state #
get_voice_state(user: SnowflakeishOr[PartialUser]) -> Optional[VoiceState]
Get a cached voice state that belongs to the guild by it's user.
PARAMETER | DESCRIPTION |
---|---|
user | The object or ID of the user to get the cached voice state for. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[VoiceState] | The cached voice state object if found, else |
get_voice_states #
get_voice_states() -> Mapping[Snowflake, VoiceState]
Get the voice states cached for the guild.
RETURNS | DESCRIPTION |
---|---|
Mapping[Snowflake, VoiceState] | A mapping of user IDs to objects of the voice states cached for the guild. |
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_discovery_splash_url #
Generate the guild's discovery splash image URL, if set.
PARAMETER | DESCRIPTION |
---|---|
ext | The extension to use for this URL, defaults to TYPE: |
size | The size to set for the URL, defaults to TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[URL] | The string URL. |
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, defaults to TYPE: |
size | The size to set for the URL, defaults to TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[URL] | The URL to the splash, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If |
GuildBan #
GuildExplicitContentFilterLevel #
Bases: int
, Enum
Represents the explicit content filter setting for a guild.
GuildFeature #
Bases: str
, Enum
Features that a guild can provide.
ANIMATED_ICON class-attribute
instance-attribute
#
ANIMATED_ICON = 'ANIMATED_ICON'
Guild has access to set an animated guild icon.
BANNER class-attribute
instance-attribute
#
BANNER = 'BANNER'
Guild has access to set a guild banner image.
COMMERCE class-attribute
instance-attribute
#
COMMERCE = 'COMMERCE'
Guild has access to use commerce features (i.e. create store channels).
COMMUNITY class-attribute
instance-attribute
#
COMMUNITY = 'COMMUNITY'
Guild has community features enabled.
CREATOR_MONETIZABLE class-attribute
instance-attribute
#
CREATOR_MONETIZABLE = 'CREATOR_MONETIZABLE_PROVISIONAL'
Guild has enabled monetization.
CREATOR_STORE_PAGE class-attribute
instance-attribute
#
CREATOR_STORE_PAGE = 'CREATOR_STORE_PAGE'
Guild has enabled the store page.
DISCOVERABLE class-attribute
instance-attribute
#
DISCOVERABLE = 'DISCOVERABLE'
Guild is able to be discovered in the directory.
This also implies the guild can be viewed without joining.
FEATURABLE class-attribute
instance-attribute
#
FEATURABLE = 'FEATURABLE'
Guild is able to be featured in the directory.
INVITES_DISABLED class-attribute
instance-attribute
#
INVITES_DISABLED = 'INVITES_DISABLED'
Guild has paused invites, preventing new users from joining.
INVITE_SPLASH class-attribute
instance-attribute
#
INVITE_SPLASH = 'INVITE_SPLASH'
Guild has access to set an invite splash background.
MEMBER_VERIFICATION_GATE_ENABLED class-attribute
instance-attribute
#
MEMBER_VERIFICATION_GATE_ENABLED = 'MEMBER_VERIFICATION_GATE_ENABLED'
Guild has enabled Membership Screening.
MONETIZATION_ENABLED class-attribute
instance-attribute
#
MONETIZATION_ENABLED = 'MONETIZATION_ENABLED'
Guild has enabled monetization.
MORE_EMOJI class-attribute
instance-attribute
#
MORE_EMOJI = 'MORE_EMOJI'
More emojis can be hosted in this guild than normal.
MORE_STICKERS class-attribute
instance-attribute
#
MORE_STICKERS = 'MORE_STICKERS'
Guild has an increased custom stickers slots.
PREVIEW_ENABLED class-attribute
instance-attribute
#
PREVIEW_ENABLED = 'PREVIEW_ENABLED'
Guild can be viewed before Membership Screening is complete.
RAID_ALERTS_DISABLED class-attribute
instance-attribute
#
RAID_ALERTS_DISABLED = 'RAID_ALERTS_DISABLED'
Guild has disabled alerts for join raids in the configured safety alerts channel.
RELAY_ENABLED class-attribute
instance-attribute
#
RELAY_ENABLED = 'RELAY_ENABLED'
Guild is using relays.
Relays are new infrastructure designed to handle large guilds more efficiently server-side.
ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE class-attribute
instance-attribute
#
ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE = 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE'
Guild has role subscriptions available for purchase.
ROLE_SUBSCRIPTIONS_ENABLED class-attribute
instance-attribute
#
ROLE_SUBSCRIPTIONS_ENABLED = 'ROLE_SUBSCRIPTIONS_ENABLED'
Guild has enabled role subscriptions.
TICKETED_EVENTS_ENABLED class-attribute
instance-attribute
#
TICKETED_EVENTS_ENABLED = 'TICKETED_EVENTS_ENABLED'
Guild has enabled ticketed events.
VANITY_URL class-attribute
instance-attribute
#
VANITY_URL = 'VANITY_URL'
Guild has access to set a vanity URL.
VIP_REGIONS class-attribute
instance-attribute
#
VIP_REGIONS = 'VIP_REGIONS'
Guild has access to set 384kbps bitrate in voice.
Previously gave access to VIP voice servers.
WELCOME_SCREEN_ENABLED class-attribute
instance-attribute
#
WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED'
Guild has enabled the welcome screen.
GuildMFALevel #
GuildMemberFlags #
Bases: Flag
Represents the flags that a member can have.
BYPASSES_VERIFICATION class-attribute
instance-attribute
#
BYPASSES_VERIFICATION = 1 << 2
Member is exempt from guild verification requirements.
COMPLETED_ONBOARDING class-attribute
instance-attribute
#
COMPLETED_ONBOARDING = 1 << 1
Member has completed onboarding.
DID_REJOIN class-attribute
instance-attribute
#
DID_REJOIN = 1 << 0
Member has left and rejoined the guild.
STARTED_ONBOARDING class-attribute
instance-attribute
#
STARTED_ONBOARDING = 1 << 3
Member has started onboarding.
GuildMessageNotificationsLevel #
Bases: int
, Enum
Represents the default notification level for new messages in a guild.
GuildNSFWLevel #
GuildPreview #
Bases: PartialGuild
A preview of a guild with the hikari.guilds.GuildFeature.DISCOVERABLE
feature.
approximate_active_member_count class-attribute
instance-attribute
#
The approximate amount of presences in this guild.
approximate_member_count class-attribute
instance-attribute
#
The approximate amount of members in this guild.
description class-attribute
instance-attribute
#
The guild's description, if set.
discovery_splash_hash class-attribute
instance-attribute
#
The hash of the discovery splash for the guild, if there is one.
discovery_splash_url property
#
Discovery URL splash for the guild, if set.
emojis class-attribute
instance-attribute
#
emojis: Mapping[Snowflake, KnownCustomEmoji] = field(eq=False, hash=False, repr=False)
The mapping of IDs to the emojis this guild provides.
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.
splash_hash class-attribute
instance-attribute
#
The hash of the splash for the guild, if there is one.
make_discovery_splash_url #
Generate the guild's discovery 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 string URL. |
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 |
GuildSystemChannelFlag #
Bases: Flag
Defines which features are suppressed in the system channel.
SUPPRESS_GUILD_REMINDER class-attribute
instance-attribute
#
SUPPRESS_GUILD_REMINDER = 1 << 2
Suppress displaying messages with guild setup tips.
SUPPRESS_PREMIUM_SUBSCRIPTION class-attribute
instance-attribute
#
SUPPRESS_PREMIUM_SUBSCRIPTION = 1 << 1
Suppress displaying a message when the guild is Nitro boosted.
SUPPRESS_USER_JOIN class-attribute
instance-attribute
#
SUPPRESS_USER_JOIN = 1 << 0
Suppress displaying a message about new users joining.
SUPPRESS_USER_JOIN_REPLIES class-attribute
instance-attribute
#
SUPPRESS_USER_JOIN_REPLIES = 1 << 3
Suppress displaying a reply button on join notifications.
GuildVerificationLevel #
GuildWidget #
Represents a guild widget.
app class-attribute
instance-attribute
#
Client application that models may use for procedures.
channel_id class-attribute
instance-attribute
#
The ID of the channel the invite for this embed targets, if enabled.
is_enabled class-attribute
instance-attribute
#
Whether this embed is enabled.
fetch_channel async
#
fetch_channel() -> Optional[GuildChannel]
Fetch the widget channel.
This will be None
if not set.
RETURNS | DESCRIPTION |
---|---|
Optional[GuildChannel] | The requested channel. You can check the type of the channel by using |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
Integration #
Bases: PartialIntegration
Represents a guild integration object.
application class-attribute
instance-attribute
#
application: Optional[IntegrationApplication] = field(eq=False, hash=False, repr=False)
The bot/OAuth2 application associated with this integration.
Note
This is only available for Discord integrations.
expire_behavior class-attribute
instance-attribute
#
expire_behavior: Union[IntegrationExpireBehaviour, int, None] = field(eq=False, hash=False, repr=False)
How members should be treated after their connected subscription expires.
This will not be enacted until after GuildIntegration.expire_grace_period
passes.
Note
This will always be None
for Discord integrations.
expire_grace_period class-attribute
instance-attribute
#
How many days users with expired subscriptions are given until the expire behavior is enacted out on them.
Note
This will always be None
for Discord integrations.
guild_id class-attribute
instance-attribute
#
The ID of the guild this integration belongs to.
is_emojis_enabled class-attribute
instance-attribute
#
Whether users under this integration are allowed to use it's custom emojis.
is_enabled class-attribute
instance-attribute
#
Whether this integration is enabled.
is_revoked class-attribute
instance-attribute
#
Whether the integration has been revoked.
is_syncing class-attribute
instance-attribute
#
Whether this integration is syncing subscribers/emojis.
last_synced_at class-attribute
instance-attribute
#
The datetime of when this integration's subscribers were last synced.
role_id class-attribute
instance-attribute
#
The ID of the managed role used for this integration's subscribers.
subscriber_count class-attribute
instance-attribute
#
The number of subscribers this integration has.
IntegrationAccount #
IntegrationApplication #
Bases: PartialApplication
An application that's linked to an integration.
IntegrationExpireBehaviour #
IntegrationType #
Member #
Bases: User
Used to represent a guild bound member.
accent_color property
#
The custom banner color for the user, if set else None
.
The official client will decide the default color if not set.
avatar_url property
#
Avatar URL for the user, if they have one set.
May be None
if no custom avatar is set. In this case, you should use hikari.User.default_avatar_url
instead.
banner_url property
#
Banner URL for the user, if they have one set.
May be None
if no custom banner is set.
discriminator property
#
discriminator: str
Discriminator for the user.
!!! deprecated 2.0.0.dev120 Discriminators are deprecated and being replaced with "0" by Discord during username migration. This field will be removed after migration is complete. Learn more here: https://dis.gd/usernames
display_name property
#
display_name: str
Return the member's display name.
If the member has a nickname, this will return that nickname. If the user has a global name, this will return that global name. If the user has neither, the username will be returned instead.
See Also
guild_avatar_hash class-attribute
instance-attribute
#
Hash of the member's guild avatar guild if set, else None
.
Note
This takes precedence over hikari.guilds.Member.avatar_hash
.
guild_avatar_url property
#
Guild Avatar URL for the user, if they have one set.
May be None
if no guild avatar is set. In this case, you should use hikari.guilds.Member.avatar_hash
or hikari.guilds.Member.default_avatar_url
instead.
guild_flags class-attribute
instance-attribute
#
guild_flags: Union[GuildMemberFlags, int] = field(eq=False, hash=False, repr=False)
The flags this member has in the guild.
guild_id class-attribute
instance-attribute
#
The ID of the guild this member belongs to.
is_deaf class-attribute
instance-attribute
#
is_deaf: UndefinedOr[bool] = field(repr=False)
True
if this member is deafened in the current voice channel.
This will be hikari.undefined.UNDEFINED
if it's state is unknown.
is_mute class-attribute
instance-attribute
#
is_mute: UndefinedOr[bool] = field(repr=False)
True
if this member is muted in the current voice channel.
This will be hikari.undefined.UNDEFINED
if it's state is unknown.
is_pending class-attribute
instance-attribute
#
is_pending: UndefinedOr[bool] = field(repr=False)
Whether the user has passed the guild's membership screening requirements.
This will be hikari.undefined.UNDEFINED
if it's state is unknown.
joined_at class-attribute
instance-attribute
#
The datetime of when this member joined the guild they belong to.
This will be None
for guest members that have been temporarily invited.
mention property
#
mention: str
Return a raw mention string for the given user.
Examples:
>>> some_user.mention
'<@123456789123456789>'
premium_since class-attribute
instance-attribute
#
The datetime of when this member started "boosting" this guild.
Will be None
if the member is not a premium user.
raw_communication_disabled_until class-attribute
instance-attribute
#
The datetime when this member's timeout will expire.
Will be None
if the member is not timed out.
Note
The datetime might be in the past, so it is recommended to use hikari.guilds.Member.communication_disabled_until
method to check if the member is timed out at the time of the call.
role_ids class-attribute
instance-attribute
#
A sequence of the IDs of the member's current roles.
user class-attribute
instance-attribute
#
This member's corresponding user object.
add_role async
#
add_role(role: SnowflakeishOr[PartialRole], *, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Add a role to the member.
PARAMETER | DESCRIPTION |
---|---|
role | The role to add. This may be the object or the ID of an existing role. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild, user or role are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
ban async
#
ban(*, delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Ban this member from this guild.
PARAMETER | DESCRIPTION |
---|---|
delete_message_seconds | If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
communication_disabled_until #
Return when the timeout for this member ends.
Unlike raw_communication_disabled_until
, this will always be None
if the member is not currently timed out.
Note
The output of this function can depend based on when the function is called.
edit async
#
edit(*, nickname: UndefinedNoneOr[str] = undefined.UNDEFINED, roles: UndefinedOr[SnowflakeishSequence[PartialRole]] = undefined.UNDEFINED, mute: UndefinedOr[bool] = undefined.UNDEFINED, deaf: UndefinedOr[bool] = undefined.UNDEFINED, voice_channel: UndefinedNoneOr[SnowflakeishOr[GuildVoiceChannel]] = undefined.UNDEFINED, communication_disabled_until: UndefinedNoneOr[datetime] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> Member
Edit the member.
PARAMETER | DESCRIPTION |
---|---|
nickname | If provided, the new nick for the member. If Requires the TYPE: |
roles | If provided, the new roles for the member. Requires the TYPE: |
mute | If provided, the new server mute state for the member. Requires the TYPE: |
deaf | If provided, the new server deaf state for the member. Requires the TYPE: |
voice_channel | If provided, Requires the Note If the member is not in a voice channel, this will take no effect. TYPE: |
communication_disabled_until | If provided, the datetime when the timeout (disable communication) of the member expires, up to 28 days in the future, or Requires the TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
Member | Object of the member that was updated. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing a permission to do an action. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or the user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_dm_channel async
#
fetch_dm_channel() -> DMChannel
Fetch the DM channel for this user.
RETURNS | DESCRIPTION |
---|---|
DMChannel | The requested channel. |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the user is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_roles async
#
Fetch an up-to-date view of this member's roles from the API.
RETURNS | DESCRIPTION |
---|---|
Sequence[Role] | An up-to-date view of this member's roles. |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the member is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_self async
#
fetch_self() -> Member
Fetch an up-to-date view of this member from the API.
RETURNS | DESCRIPTION |
---|---|
Member | An up-to-date view of this member. |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the member is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
get_guild #
get_presence #
get_presence() -> Optional[MemberPresence]
Get the cached presence for this member, if known.
Presence info includes user status and activities.
This requires the hikari.intents.Intents.GUILD_PRESENCES
intent to be enabled.
RETURNS | DESCRIPTION |
---|---|
Optional[MemberPresence] | The member presence, or |
get_roles #
get_top_role #
kick async
#
kick(*, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Kick this member from this guild.
PARAMETER | DESCRIPTION |
---|---|
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
make_avatar_url #
Generate the avatar URL for this user, if set.
If no custom avatar is set, this returns None
. You can then use the hikari.User.default_avatar_url
attribute instead to fetch the displayed URL.
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 to the avatar, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If |
make_guild_avatar_url #
Generate the guild specific avatar url for this member, if set.
If no guild avatar is set, this returns None
.
PARAMETER | DESCRIPTION |
---|---|
ext | The ext to use for this URL. Supports Will be ignored for default avatars which can only be If |
size | The size to set for the URL. Can be any power of two between TYPE: |
RETURNS | DESCRIPTION |
---|---|
Optional[URL] | The URL to the avatar, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If |
remove_role async
#
remove_role(role: SnowflakeishOr[PartialRole], *, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Remove a role from the member.
PARAMETER | DESCRIPTION |
---|---|
role | The role to remove. This may be the object or the ID of an existing role. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild, user or role are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
unban async
#
unban(*, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Unban this member from the guild.
PARAMETER | DESCRIPTION |
---|---|
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
PartialApplication #
Bases: Unique
A partial representation of a Discord application.
description class-attribute
instance-attribute
#
The description of this application, if any.
icon_hash class-attribute
instance-attribute
#
The CDN hash of this application's icon, if set.
id class-attribute
instance-attribute
#
The ID of this entity.
name class-attribute
instance-attribute
#
The name of this application.
make_icon_url #
Generate the icon URL for this application.
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, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If the size is not an integer power of 2 between 16 and 4096 (inclusive). |
PartialGuild #
Bases: Unique
Base object for any partial guild objects.
app class-attribute
instance-attribute
#
Client application that models may use for procedures.
icon_hash class-attribute
instance-attribute
#
The hash for the guild icon, if there is one.
id class-attribute
instance-attribute
#
The ID of this entity.
name class-attribute
instance-attribute
#
The name of the guild.
shard_id property
#
Return the ID of the shard this guild is served by.
This may return None
if the application does not have a gateway connection.
ban async
#
ban(user: SnowflakeishOr[PartialUser], *, delete_message_seconds: UndefinedOr[Intervalish] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Ban the given user from this guild.
PARAMETER | DESCRIPTION |
---|---|
user | The user to ban from the guild. TYPE: |
delete_message_seconds | If provided, the number of seconds to delete messages for. This can be represented as either an int/float between 0 and 604800 (7 days), or a TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
create_category async
#
create_category(name: str, *, position: UndefinedOr[int] = undefined.UNDEFINED, permission_overwrites: UndefinedOr[Sequence[PermissionOverwrite]] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildCategory
Create a category in the guild.
PARAMETER | DESCRIPTION |
---|---|
name | The channels name. Must be between 2 and 1000 characters. TYPE: |
position | If provided, the position of the category. TYPE: |
permission_overwrites | If provided, the permission overwrites for the category. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildCategory | The created category. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
create_forum_channel async
#
create_forum_channel(name: str, *, position: UndefinedOr[int] = undefined.UNDEFINED, category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED, permission_overwrites: UndefinedOr[Sequence[PermissionOverwrite]] = undefined.UNDEFINED, topic: UndefinedOr[str] = undefined.UNDEFINED, nsfw: UndefinedOr[bool] = undefined.UNDEFINED, rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED, default_auto_archive_duration: UndefinedOr[Intervalish] = undefined.UNDEFINED, default_thread_rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED, default_forum_layout: UndefinedOr[Union[ForumLayoutType, int]] = undefined.UNDEFINED, default_sort_order: UndefinedOr[Union[ForumSortOrderType, int]] = undefined.UNDEFINED, available_tags: UndefinedOr[Sequence[ForumTag]] = undefined.UNDEFINED, default_reaction_emoji: Union[str, Emoji, UndefinedType, Snowflake] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildForumChannel
Create a forum channel in the guild.
PARAMETER | DESCRIPTION |
---|---|
name | The channels name. Must be between 2 and 1000 characters. TYPE: |
position | If provided, the position of the category. TYPE: |
category | The category to create the channel under. This may be the object or the ID of an existing category. TYPE: |
permission_overwrites | If provided, the permission overwrites for the category. TYPE: |
topic | If provided, the channels topic. Maximum 1024 characters. TYPE: |
nsfw | If provided, whether to mark the channel as NSFW. TYPE: |
rate_limit_per_user | If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds. TYPE: |
default_auto_archive_duration | If provided, the auto archive duration Discord's end user client should default to when creating threads in this channel. This should be either 60, 1440, 4320 or 10080 minutes and, as of writing, ignores the parent channel's set default_auto_archive_duration when passed as TYPE: |
default_thread_rate_limit_per_user | If provided, the ratelimit that should be set in threads created from the forum. TYPE: |
default_forum_layout | If provided, the default forum layout to show in the client. TYPE: |
default_sort_order | If provided, the default sort order to show in the client. TYPE: |
available_tags | If provided, the available tags to select from when creating a thread. TYPE: |
default_reaction_emoji | If provided, the new default reaction emoji for threads created in a forum channel. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildForumChannel | The created forum channel. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
create_news_channel async
#
create_news_channel(name: str, *, position: UndefinedOr[int] = undefined.UNDEFINED, topic: UndefinedOr[str] = undefined.UNDEFINED, nsfw: UndefinedOr[bool] = undefined.UNDEFINED, rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED, permission_overwrites: UndefinedOr[Sequence[PermissionOverwrite]] = undefined.UNDEFINED, category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildNewsChannel
Create a news channel in the guild.
PARAMETER | DESCRIPTION |
---|---|
name | The channels name. Must be between 2 and 1000 characters. TYPE: |
position | If provided, the position of the channel (relative to the category, if any). TYPE: |
topic | If provided, the channels topic. Maximum 1024 characters. TYPE: |
nsfw | If provided, whether to mark the channel as NSFW. TYPE: |
rate_limit_per_user | If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds. TYPE: |
permission_overwrites | If provided, the permission overwrites for the channel. TYPE: |
category | The category to create the channel under. This may be the object or the ID of an existing category. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildNewsChannel | The created channel. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
create_stage_channel async
#
create_stage_channel(name: str, *, position: UndefinedOr[int] = undefined.UNDEFINED, user_limit: UndefinedOr[int] = undefined.UNDEFINED, bitrate: UndefinedOr[int] = undefined.UNDEFINED, permission_overwrites: UndefinedOr[Sequence[PermissionOverwrite]] = undefined.UNDEFINED, region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED, category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildStageChannel
Create a stage channel in the guild.
PARAMETER | DESCRIPTION |
---|---|
name | The channel's name. Must be between 2 and 1000 characters. TYPE: |
position | If provided, the position of the channel (relative to the category, if any). TYPE: |
user_limit | If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit. TYPE: |
bitrate | If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers. TYPE: |
permission_overwrites | If provided, the permission overwrites for the channel. TYPE: |
region | If provided, the voice region to for this channel. Passing TYPE: |
category | The category to create the channel under. This may be the object or the ID of an existing category. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildStageChannel | The created channel. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
create_sticker async
#
create_sticker(name: str, tag: str, image: Resourceish, *, description: UndefinedOr[str] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildSticker
Create a sticker in a guild.
Note
Lottie support is only available for verified and partnered servers.
PARAMETER | DESCRIPTION |
---|---|
name | The name for the sticker. TYPE: |
tag | The tag for the sticker. TYPE: |
image | The 320x320 image for the sticker. Maximum upload size is 500kb. This can be a still PNG, an animated PNG, a Lottie, or a GIF. TYPE: |
description | If provided, the description of the sticker. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildSticker | The created sticker. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value or if there are no more spaces for the sticker in the guild. |
ForbiddenError | If you are missing |
NotFoundError | If the guild is not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
create_text_channel async
#
create_text_channel(name: str, *, position: UndefinedOr[int] = undefined.UNDEFINED, topic: UndefinedOr[str] = undefined.UNDEFINED, nsfw: UndefinedOr[bool] = undefined.UNDEFINED, rate_limit_per_user: UndefinedOr[Intervalish] = undefined.UNDEFINED, permission_overwrites: UndefinedOr[Sequence[PermissionOverwrite]] = undefined.UNDEFINED, category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildTextChannel
Create a text channel in the guild.
PARAMETER | DESCRIPTION |
---|---|
name | The channels name. Must be between 2 and 1000 characters. TYPE: |
position | If provided, the position of the channel (relative to the category, if any). TYPE: |
topic | If provided, the channels topic. Maximum 1024 characters. TYPE: |
nsfw | If provided, whether to mark the channel as NSFW. TYPE: |
rate_limit_per_user | If provided, the amount of seconds a user has to wait before being able to send another message in the channel. Maximum 21600 seconds. TYPE: |
permission_overwrites | If provided, the permission overwrites for the channel. TYPE: |
category | The category to create the channel under. This may be the object or the ID of an existing category. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildTextChannel | The created channel. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
create_voice_channel async
#
create_voice_channel(name: str, *, position: UndefinedOr[int] = undefined.UNDEFINED, user_limit: UndefinedOr[int] = undefined.UNDEFINED, bitrate: UndefinedOr[int] = undefined.UNDEFINED, video_quality_mode: UndefinedOr[Union[VideoQualityMode, int]] = undefined.UNDEFINED, permission_overwrites: UndefinedOr[Sequence[PermissionOverwrite]] = undefined.UNDEFINED, region: UndefinedOr[Union[VoiceRegion, str]] = undefined.UNDEFINED, category: UndefinedOr[SnowflakeishOr[GuildCategory]] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildVoiceChannel
Create a voice channel in a guild.
PARAMETER | DESCRIPTION |
---|---|
name | The channels name. Must be between 2 and 1000 characters. TYPE: |
position | If provided, the position of the channel (relative to the category, if any). TYPE: |
user_limit | If provided, the maximum users in the channel at once. Must be between 0 and 99 with 0 meaning no limit. TYPE: |
bitrate | If provided, the bitrate for the channel. Must be between 8000 and 96000 or 8000 and 128000 for VIP servers. TYPE: |
video_quality_mode | If provided, the new video quality mode for the channel. TYPE: |
permission_overwrites | If provided, the permission overwrites for the channel. TYPE: |
region | If provided, the voice region to for this channel. Passing TYPE: |
category | The category to create the channel under. This may be the object or the ID of an existing category. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildVoiceChannel | The created channel. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the gui ld is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
delete_channel async
#
delete_channel(channel: SnowflakeishOr[GuildChannel]) -> GuildChannel
Delete a channel in the guild.
Note
This method can also be used for deleting guild categories as well.
Note
For Public servers, the set 'Rules' or 'Guidelines' channels and the 'Public Server Updates' channel cannot be deleted.
PARAMETER | DESCRIPTION |
---|---|
channel | The channel or category to delete. This may be the object or the ID of an existing channel. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildChannel | Object of the channel or category that was deleted. |
RAISES | DESCRIPTION |
---|---|
hikari.errors.UnauthorizedError, or close a DM. | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
delete_sticker async
#
delete_sticker(sticker: SnowflakeishOr[PartialSticker], *, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Delete a sticker in a guild.
PARAMETER | DESCRIPTION |
---|---|
sticker | The sticker to delete. This can be a sticker object or the ID of an existing sticker. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
ForbiddenError | If you are missing |
NotFoundError | If the guild or the sticker are not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
edit async
#
edit(*, name: UndefinedOr[str] = undefined.UNDEFINED, verification_level: UndefinedOr[GuildVerificationLevel] = undefined.UNDEFINED, default_message_notifications: UndefinedOr[GuildMessageNotificationsLevel] = undefined.UNDEFINED, explicit_content_filter_level: UndefinedOr[GuildExplicitContentFilterLevel] = undefined.UNDEFINED, afk_channel: UndefinedOr[SnowflakeishOr[GuildVoiceChannel]] = undefined.UNDEFINED, afk_timeout: UndefinedOr[Intervalish] = undefined.UNDEFINED, icon: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED, owner: UndefinedOr[SnowflakeishOr[PartialUser]] = undefined.UNDEFINED, splash: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED, banner: UndefinedNoneOr[Resourceish] = undefined.UNDEFINED, system_channel: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] = undefined.UNDEFINED, rules_channel: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] = undefined.UNDEFINED, public_updates_channel: UndefinedNoneOr[SnowflakeishOr[GuildTextChannel]] = undefined.UNDEFINED, preferred_locale: UndefinedOr[Union[str, Locale]] = undefined.UNDEFINED, features: UndefinedOr[Sequence[GuildFeature]] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> RESTGuild
Edit the guild.
PARAMETER | DESCRIPTION |
---|---|
name | If provided, the new name for the guild. TYPE: |
verification_level | If provided, the new verification level. TYPE: |
default_message_notifications | If provided, the new default message notifications level. TYPE: |
explicit_content_filter_level | If provided, the new explicit content filter level. TYPE: |
afk_channel | If provided, the new afk channel. Requires TYPE: |
afk_timeout | If provided, the new afk timeout. TYPE: |
icon | If provided, the new guild icon. Must be a 1024x1024 image or can be an animated gif when the guild has the TYPE: |
owner | If provided, the new guild owner. Warning You need to be the owner of the server to use this. TYPE: |
splash | If provided, the new guild splash. Must be a 16:9 image and the guild must have the TYPE: |
banner | If provided, the new guild banner. Must be a 16:9 image and the guild must have the TYPE: |
system_channel | If provided, the new system channel. TYPE: |
rules_channel | If provided, the new rules channel. TYPE: |
public_updates_channel | If provided, the new public updates channel. TYPE: |
preferred_locale | If provided, the new preferred locale. TYPE: |
features | If provided, the guild features to be enabled. Features not provided will be disabled. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
RESTGuild | The edited guild. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. Or you are missing the |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
edit_sticker async
#
edit_sticker(sticker: SnowflakeishOr[PartialSticker], *, name: UndefinedOr[str] = undefined.UNDEFINED, description: UndefinedOr[str] = undefined.UNDEFINED, tag: UndefinedOr[str] = undefined.UNDEFINED, reason: UndefinedOr[str] = undefined.UNDEFINED) -> GuildSticker
Edit a sticker in a guild.
PARAMETER | DESCRIPTION |
---|---|
sticker | The sticker to edit. This can be a sticker object or the ID of an existing sticker. TYPE: |
name | If provided, the new name for the sticker. TYPE: |
description | If provided, the new description for the sticker. TYPE: |
tag | If provided, the new sticker tag. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildSticker | The edited sticker. |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing |
NotFoundError | If the guild or the sticker are not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_emoji async
#
fetch_emoji(emoji: SnowflakeishOr[CustomEmoji]) -> KnownCustomEmoji
Fetch an emoji from the guild.
PARAMETER | DESCRIPTION |
---|---|
emoji | The emoji to fetch. This can be a TYPE: |
RETURNS | DESCRIPTION |
---|---|
KnownCustomEmoji | The requested emoji. |
RAISES | DESCRIPTION |
---|---|
NotFoundError | If the guild or the emoji are not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_emojis async
#
fetch_emojis() -> Sequence[KnownCustomEmoji]
Fetch the emojis of the guild.
RETURNS | DESCRIPTION |
---|---|
Sequence[KnownCustomEmoji] | The requested emojis. |
RAISES | DESCRIPTION |
---|---|
NotFoundError | If the guild is not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_roles async
#
Fetch the roles of the guild.
RETURNS | DESCRIPTION |
---|---|
Sequence[Role] | The requested roles. |
RAISES | DESCRIPTION |
---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_self async
#
fetch_self() -> RESTGuild
Fetch the guild.
RETURNS | DESCRIPTION |
---|---|
RESTGuild | The requested guild. |
RAISES | DESCRIPTION |
---|---|
ForbiddenError | If you are not part of the guild. |
NotFoundError | If the guild is not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_sticker async
#
fetch_sticker(sticker: SnowflakeishOr[PartialSticker]) -> GuildSticker
Fetch a sticker from the guild.
PARAMETER | DESCRIPTION |
---|---|
sticker | The sticker to fetch. This can be a sticker object or the ID of an existing sticker. TYPE: |
RETURNS | DESCRIPTION |
---|---|
GuildSticker | The requested sticker. |
RAISES | DESCRIPTION |
---|---|
ForbiddenError | If you are not part of the server. |
NotFoundError | If the guild or the sticker are not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_stickers async
#
fetch_stickers() -> Sequence[GuildSticker]
Fetch the stickers of the guild.
RETURNS | DESCRIPTION |
---|---|
Sequence[GuildSticker] | The requested stickers. |
RAISES | DESCRIPTION |
---|---|
ForbiddenError | If you are not part of the server. |
NotFoundError | If the guild is not found. |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
kick async
#
kick(user: SnowflakeishOr[PartialUser], *, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Kick the given user from this guild.
PARAMETER | DESCRIPTION |
---|---|
user | The user to kick from the guild. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
make_icon_url #
Generate the guild's icon URL, if set.
PARAMETER | DESCRIPTION |
---|---|
ext | The extension 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 to the resource, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If |
unban async
#
unban(user: SnowflakeishOr[PartialUser], *, reason: UndefinedOr[str] = undefined.UNDEFINED) -> None
Unban the given user from this guild.
PARAMETER | DESCRIPTION |
---|---|
user | The user to unban from the guild. TYPE: |
reason | If provided, the reason that will be recorded in the audit logs. Maximum of 512 characters. TYPE: |
RAISES | DESCRIPTION |
---|---|
BadRequestError | If any of the fields that are passed have an invalid value. |
ForbiddenError | If you are missing the |
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the guild or user are not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
PartialIntegration #
Bases: Unique
A partial representation of an integration, found in audit logs.
account class-attribute
instance-attribute
#
account: IntegrationAccount = field(eq=False, hash=False, repr=False)
The account connected to this integration.
id class-attribute
instance-attribute
#
The ID of this entity.
name class-attribute
instance-attribute
#
The name of this integration.
type class-attribute
instance-attribute
#
type: Union[IntegrationType, str] = field(eq=False, hash=False, repr=True)
The type of this integration.
PartialRole #
RESTGuild #
Bases: Guild
Guild specialization that is sent via the REST API only.
approximate_active_member_count class-attribute
instance-attribute
#
The approximate number of members in the guild that are not offline.
This will be None
when creating a guild.
approximate_member_count class-attribute
instance-attribute
#
The approximate number of members in the guild.
This will be None
when creating a guild.
emojis class-attribute
instance-attribute
#
emojis: Mapping[Snowflake, KnownCustomEmoji] = field(eq=False, hash=False, repr=False)
A mapping of emoji IDs to the objects of the emojis this guild provides.
max_members class-attribute
instance-attribute
#
The maximum number of members allowed in this guild.
max_presences class-attribute
instance-attribute
#
The maximum number of presences for the guild.
If None
, then there is no limit.
roles class-attribute
instance-attribute
#
The roles in this guild, represented as a mapping of role ID to role object.
Role #
Bases: PartialRole
Represents a guild bound role object.
bot_id class-attribute
instance-attribute
#
The ID of the bot this role belongs to.
If None
, this is not a bot role.
color class-attribute
instance-attribute
#
The colour of this role.
This will be applied to a member's name in chat if it's their top coloured role.
guild_id class-attribute
instance-attribute
#
The ID of the guild this role belongs to.
integration_id class-attribute
instance-attribute
#
The ID of the integration this role belongs to.
If None
, this is not a integration role.
is_available_for_purchase class-attribute
instance-attribute
#
Whether this role is available for purchase.
is_guild_linked_role class-attribute
instance-attribute
#
Whether this role is a linked role in the guild.
is_hoisted class-attribute
instance-attribute
#
Whether this role is hoisting the members it's attached to in the member list.
Members will be hoisted under their highest role where this is set to True
.
is_managed class-attribute
instance-attribute
#
Whether this role is managed by an integration.
is_mentionable class-attribute
instance-attribute
#
Whether this role can be mentioned by all regardless of permissions.
is_premium_subscriber_role class-attribute
instance-attribute
#
Whether this role is the guild's nitro subscriber role.
mention property
#
mention: str
Return a raw mention string for the role.
When this role represents @everyone mentions will only work if mentions_everyone
is True
.
permissions class-attribute
instance-attribute
#
permissions: Permissions = field(eq=False, hash=False, repr=False)
The guild wide permissions this role gives to the members it's attached to.
This may be overridden by channel overwrites.
position class-attribute
instance-attribute
#
The position of this role in the role hierarchy.
This will start at 0
for the lowest role (@everyone) and increase as you go up the hierarchy.
subscription_listing_id class-attribute
instance-attribute
#
The ID of this role's subscription SKU and listing.
If None
, this is not a purchasable role.
unicode_emoji class-attribute
instance-attribute
#
unicode_emoji: Optional[UnicodeEmoji] = field(eq=False, hash=False, repr=False)
Role's icon as an unicode emoji if set, else None
.
make_icon_url #
Generate the icon URL for this role, if set.
If no role icon is set, this returns None
.
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 icon, or |
RAISES | DESCRIPTION |
---|---|
ValueError | If |
WelcomeChannel #
Used to represent channels on guild welcome screens.
channel_id class-attribute
instance-attribute
#
ID of the channel shown in the welcome screen.
description class-attribute
instance-attribute
#
The description shown for this channel.
emoji_id class-attribute
instance-attribute
#
ID of the emoji shown in the welcome screen channel if it's set to a custom emoji.
emoji_name class-attribute
instance-attribute
#
emoji_name: Union[str, UnicodeEmoji, None] = field(default=None, kw_only=True, hash=False, repr=True)
The emoji shown in the welcome screen channel if set to a unicode emoji.
Warning
While it may also be present for custom emojis, this is neither guaranteed to be provided nor accurate.
WelcomeScreen #
Used to represent guild welcome screens on Discord.
channels class-attribute
instance-attribute
#
channels: Sequence[WelcomeChannel] = field(hash=False, repr=True)
An array of up to 5 of the channels shown in the welcome screen.