hikari.events.channel_events#
Events that fire when channels are modified.
This does not include message events, nor reaction events.
ChannelEvent #
Bases: ShardEvent, ABC
Event base for any channel-bound event in guilds or private messages.
fetch_channel abstractmethod async #
fetch_channel() -> PartialChannel
Perform an API call to fetch the details about this channel.
Note
For hikari.events.channel_events.GuildChannelDeleteEvent events, this will always raise an exception, since the channel will have already been removed.
| RETURNS | DESCRIPTION |
|---|---|
PartialChannel | A derivative of |
| 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. |
DMChannelEvent #
Bases: ChannelEvent, ABC
Event base for any channel-bound event in private messages.
fetch_channel async #
fetch_channel() -> PrivateChannel
Perform an API call to fetch the details about this channel.
Note
For hikari.events.channel_events.GuildChannelDeleteEvent events, this will always raise an exception, since the channel will have already been removed.
| RETURNS | DESCRIPTION |
|---|---|
PrivateChannel | A derivative of |
| 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. |
DMPinsUpdateEvent #
Bases: PinsUpdateEvent, DMChannelEvent
Event fired when a message is pinned/unpinned in a private channel.
app class-attribute instance-attribute #
App instance for this application.
channel_id class-attribute instance-attribute #
ID of the channel the event relates to.
last_pin_timestamp class-attribute instance-attribute #
Datetime of when the most recent message was pinned in the channel.
Will be None if nothing is pinned or the information is unavailable.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
fetch_channel async #
fetch_channel() -> DMChannel
Perform an API call to fetch the details about this channel.
| RETURNS | DESCRIPTION |
|---|---|
DMChannel | A derivative of |
| RAISES | DESCRIPTION |
|---|---|
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. |
GuildChannelCreateEvent #
Bases: GuildChannelEvent
Event fired when a guild channel is created.
channel class-attribute instance-attribute #
channel: PermissibleGuildChannel = attrs.field(repr=True)
Guild channel that this event represents.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
GuildChannelDeleteEvent #
Bases: GuildChannelEvent
Event fired when a guild channel is deleted.
channel class-attribute instance-attribute #
channel: PermissibleGuildChannel = attrs.field(repr=True)
Guild channel that this event represents.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
fetch_channel async #
fetch_channel() -> NoReturn
Perform an API call to fetch the details about this channel.
Note
For hikari.events.channel_events.GuildChannelDeleteEvent events, this will always raise an exception, since the channel will have already been removed.
| RETURNS | DESCRIPTION |
|---|---|
GuildChannel | A derivative of |
| 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. |
GuildChannelEvent #
Bases: ChannelEvent, ABC
Event base for any channel-bound event in guilds.
fetch_channel async #
fetch_channel() -> GuildChannel
Perform an API call to fetch the details about this channel.
Note
For hikari.events.channel_events.GuildChannelDeleteEvent events, this will always raise an exception, since the channel will have already been removed.
| RETURNS | DESCRIPTION |
|---|---|
GuildChannel | A derivative of |
| 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_guild async #
fetch_guild() -> RESTGuild
Perform an API call to fetch the guild that this event relates to.
| RETURNS | DESCRIPTION |
|---|---|
RESTGuild | The guild that this event occurred in. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are not part of the guild. |
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. |
get_channel #
get_channel() -> PermissibleGuildChannel | None
Get the cached channel that this event relates to, if known.
If not, return None.
| RETURNS | DESCRIPTION |
|---|---|
Optional[GuildChannel] | The cached channel this event relates to. If not known, this will return |
get_guild #
get_guild() -> GatewayGuild | None
Get the cached guild that this event relates to, if known.
If not, return None.
| RETURNS | DESCRIPTION |
|---|---|
Optional[GatewayGuild] | The gateway guild this event relates to, if known. Otherwise this will return |
GuildChannelUpdateEvent #
Bases: GuildChannelEvent
Event fired when a guild channel is edited.
channel class-attribute instance-attribute #
channel: PermissibleGuildChannel = attrs.field(repr=True)
Guild channel that this event represents.
old_channel class-attribute instance-attribute #
old_channel: PermissibleGuildChannel | None = attrs.field(
repr=True
)
The old guild channel object.
This will be None if the channel missing from the cache.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
GuildPinsUpdateEvent #
Bases: PinsUpdateEvent, GuildChannelEvent
Event fired when a message is pinned/unpinned in a guild channel.
app class-attribute instance-attribute #
App instance for this application.
channel_id class-attribute instance-attribute #
ID of the channel the event relates to.
guild_id class-attribute instance-attribute #
ID of the guild that this event relates to.
last_pin_timestamp class-attribute instance-attribute #
Datetime of when the most recent message was pinned in the channel.
Will be None if nothing is pinned or the information is unavailable.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
fetch_channel async #
fetch_channel() -> TextableGuildChannel
Perform an API call to fetch the details about this channel.
| RETURNS | DESCRIPTION |
|---|---|
TextableGuildChannel | A derivative of |
| 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() -> PermissibleGuildChannel | None
Get the cached channel that this event relates to, if known.
If not, return None.
| RETURNS | DESCRIPTION |
|---|---|
Optional[TextableGuildChannel] | The cached channel this event relates to. If not known, this will return |
GuildThreadAccessEvent #
Bases: GuildThreadEvent
Event fired when you're given access to an existing private thread.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
thread class-attribute instance-attribute #
thread: GuildThreadChannel = attrs.field()
The thread that you've been given access to.
GuildThreadCreateEvent #
Bases: GuildThreadEvent
Event fired when a new thread is created.
This event is fired when you create a private thread or anybody creates a public thread in a channel you can access.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
thread class-attribute instance-attribute #
thread: GuildThreadChannel = attrs.field()
The thread that was created.
GuildThreadDeleteEvent #
Bases: GuildThreadEvent
Event fired when a thread is deleted.
app class-attribute instance-attribute #
App instance for this application.
guild_id class-attribute instance-attribute #
ID of the guild this event is for.
parent_id class-attribute instance-attribute #
The ID of the channel that the thread was deleted from.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
thread_id class-attribute instance-attribute #
ID of the thread this event is for.
type class-attribute instance-attribute #
type: ChannelType = attrs.field()
The type of thread that was deleted.
GuildThreadEvent #
Bases: ShardEvent, ABC
Event base for any event that is related to a guild thread.
fetch_channel async #
fetch_channel() -> GuildThreadChannel
Perform an API call to fetch the details about this thread.
Note
For hikari.events.channel_events.GuildThreadDeleteEvent events, this will always raise an exception, since the channel will have already been removed.
| RETURNS | DESCRIPTION |
|---|---|
GuildThreadChannel | A derivative of |
| 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. |
GuildThreadUpdateEvent #
Bases: GuildThreadEvent
Event fired when a thread is updated.
old_thread class-attribute instance-attribute #
old_thread: GuildThreadChannel | None = attrs.field(
repr=True
)
The old thread object.
This will be None if the thread is missing from the cache.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
thread class-attribute instance-attribute #
thread: GuildThreadChannel = attrs.field()
The thread that was updated.
InviteCreateEvent #
Bases: InviteEvent
Event fired when an invite is created in a channel.
invite class-attribute instance-attribute #
invite: InviteWithMetadata = attrs.field()
Invite that was created.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
InviteDeleteEvent #
Bases: InviteEvent
Event fired when an invite is deleted from a channel.
app class-attribute instance-attribute #
App instance for this application.
channel_id class-attribute instance-attribute #
ID of the channel the event relates to.
code class-attribute instance-attribute #
Code that is used in the URL for the invite.
guild_id class-attribute instance-attribute #
ID of the guild that this event relates to.
old_invite class-attribute instance-attribute #
old_invite: InviteWithMetadata | None = attrs.field()
Object of the old cached invite.
This will be None if the invite is missing from the cache.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
fetch_invite async #
fetch_invite() -> NoReturn
Perform an API call to retrieve an up-to-date image of this invite.
| RETURNS | DESCRIPTION |
|---|---|
Invite | The invite object. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the invite 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. |
InviteEvent #
Bases: GuildChannelEvent, ABC
Base event type for guild invite updates.
fetch_invite async #
fetch_invite() -> Invite
Perform an API call to retrieve an up-to-date image of this invite.
| RETURNS | DESCRIPTION |
|---|---|
Invite | The invite object. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the invite 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. |
PinsUpdateEvent #
Bases: ChannelEvent, ABC
Base event fired when a message is pinned/unpinned in a channel.
last_pin_timestamp abstractmethod property #
last_pin_timestamp: datetime | None
Datetime of when the most recent message was pinned in the channel.
Will be None if nothing is pinned or the information is unavailable.
fetch_channel abstractmethod async #
fetch_channel() -> TextableChannel
Perform an API call to fetch the details about this channel.
| RETURNS | DESCRIPTION |
|---|---|
TextableChannel | A derivative of |
fetch_pins #
fetch_pins() -> LazyIterator[PinnedMessage]
Perform an API call to fetch the pinned messages in this channel.
| RETURNS | DESCRIPTION |
|---|---|
LazyIterator[PinnedMessage] | The pinned messages in this channel. |
ThreadListSyncEvent #
Bases: ShardEvent
Event fired to sync threads when the bot gains access to one or more channels.
app class-attribute instance-attribute #
App instance for this application.
channel_ids class-attribute instance-attribute #
IDs of the text channels threads are being synced for.
If this is None then threads are being synced for all text channels in the guild.
This may contain channels that have no active threads as well to allow for clearing stale data.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
ThreadMembersUpdateEvent #
Bases: GuildThreadEvent
Event fired when a thread's members are updated.
added_members class-attribute instance-attribute #
added_members: Mapping[Snowflake, ThreadMember] = (
attrs.field()
)
Mapping of IDs to objects of the members which were added to the thread.
app class-attribute instance-attribute #
App instance for this application.
approximate_member_count class-attribute instance-attribute #
Approximate count of members in the thread channel.
Warning
This stops counting at 50 for threads created before 2022/06/01.
guild_id class-attribute instance-attribute #
ID of the guild this event is for.
guild_members class-attribute instance-attribute #
Mapping of IDs to guild member objects of the added thread members.
Will only be filled if the hikari.intents.Intents.GUILD_MEMBERS intent is declared.
guild_presences class-attribute instance-attribute #
guild_presences: Mapping[Snowflake, MemberPresence] = (
attrs.field()
)
Mapping of IDs to guild presence objects of the added members.
Will only be filled if the hikari.intents.Intents.GUILD_PRESENCES intent is declared.
removed_member_ids class-attribute instance-attribute #
Sequence of IDs of users which were removed from the thread.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
WebhookUpdateEvent #
Bases: GuildChannelEvent
Event fired when a webhook is created/updated/deleted in a channel.
Unfortunately, Discord does not provide any information on what webhook actually changed, nor specifically whether it was created/updated/deleted, so this event is pretty useless unless you keep track of the webhooks in the channel manually beforehand.
app class-attribute instance-attribute #
App instance for this application.
channel_id class-attribute instance-attribute #
ID of the channel the event relates to.
guild_id class-attribute instance-attribute #
ID of the guild that this event relates to.
shard class-attribute instance-attribute #
shard: GatewayShard = attrs.field(
metadata={attrs_extensions.SKIP_DEEP_COPY: True}
)
Shard that received this event.
fetch_channel_webhooks async #
fetch_channel_webhooks() -> Sequence[PartialWebhook]
Perform an API call to fetch the webhooks for this channel.
| RETURNS | DESCRIPTION |
|---|---|
Sequence[PartialWebhook] | The webhooks in this channel. |
| 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_guild_webhooks async #
fetch_guild_webhooks() -> Sequence[PartialWebhook]
Perform an API call to fetch the webhooks for this guild.
| RETURNS | DESCRIPTION |
|---|---|
Sequence[PartialWebhook] | The webhooks in this guild. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
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. |