A sane Python framework for writing modern Discord bots.
To get started, you will want to initialize an instance of GatewayBot
for writing a bot, or RESTApp
if you only need to use the REST API.
# -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""A sane Python framework for writing modern Discord bots.
To get started, you will want to initialize an instance of `GatewayBot`
for writing a bot, or `RESTApp` if you only need to use the REST API.
"""
from __future__ import annotations
import os as _os
from hikari import api
from hikari import applications
from hikari import events
from hikari import files
from hikari import impl
from hikari import interactions
from hikari import snowflakes
from hikari import undefined
from hikari._about import __author__
from hikari._about import __ci__
from hikari._about import __copyright__
from hikari._about import __discord_invite__
from hikari._about import __docs__
from hikari._about import __email__
from hikari._about import __issue_tracker__
from hikari._about import __license__
from hikari._about import __url__
from hikari._about import __version__
from hikari.applications import Application
from hikari.applications import ApplicationFlags
from hikari.applications import AuthorizationApplication
from hikari.applications import AuthorizationInformation
from hikari.applications import ConnectionVisibility
from hikari.applications import OAuth2AuthorizationToken
from hikari.applications import OAuth2ImplicitToken
from hikari.applications import OAuth2Scope
from hikari.applications import OwnConnection
from hikari.applications import OwnGuild
from hikari.applications import PartialOAuth2Token
from hikari.applications import Team
from hikari.applications import TeamMember
from hikari.applications import TeamMembershipState
from hikari.applications import TokenType
from hikari.audit_logs import *
from hikari.channels import *
from hikari.colors import *
from hikari.colours import *
from hikari.commands import *
from hikari.embeds import *
from hikari.emojis import *
from hikari.errors import *
from hikari.events.base_events import Event
from hikari.events.base_events import ExceptionEvent
from hikari.events.channel_events import *
from hikari.events.guild_events import *
from hikari.events.interaction_events import *
from hikari.events.lifetime_events import *
from hikari.events.member_events import *
from hikari.events.message_events import *
from hikari.events.reaction_events import *
from hikari.events.role_events import *
from hikari.events.scheduled_events import *
from hikari.events.shard_events import *
from hikari.events.typing_events import *
from hikari.events.user_events import *
from hikari.events.voice_events import *
from hikari.files import URL
from hikari.files import Bytes
from hikari.files import File
from hikari.files import LazyByteIteratorish
from hikari.files import Pathish
from hikari.files import Rawish
from hikari.files import Resourceish
from hikari.guilds import *
from hikari.impl import ClientCredentialsStrategy
from hikari.impl import GatewayBot
from hikari.impl import RESTApp
from hikari.impl import RESTBot
from hikari.intents import *
from hikari.interactions.base_interactions import *
from hikari.interactions.command_interactions import *
from hikari.interactions.component_interactions import *
from hikari.invites import *
from hikari.iterators import *
from hikari.locales import *
from hikari.messages import *
from hikari.permissions import *
from hikari.presences import *
from hikari.scheduled_events import *
from hikari.sessions import *
from hikari.snowflakes import SearchableSnowflakeish
from hikari.snowflakes import SearchableSnowflakeishOr
from hikari.snowflakes import Snowflake
from hikari.snowflakes import Snowflakeish
from hikari.snowflakes import SnowflakeishOr
from hikari.snowflakes import SnowflakeishSequence
from hikari.snowflakes import Unique
from hikari.stickers import *
from hikari.templates import *
from hikari.traits import *
from hikari.undefined import UNDEFINED
from hikari.undefined import UndefinedNoneOr
from hikari.undefined import UndefinedOr
from hikari.undefined import UndefinedType
from hikari.users import *
from hikari.voices import *
from hikari.webhooks import *
# Only expose this during documentation, as we need it to make anything visible.
if _os.getenv("PDOC3_GENERATING") == "1": # pragma: no cover
__all__ = [name for name in dir() if not name.startswith("_")]
del _os
Interfaces for components that make up Hikari applications …
Application and entities related to discord's OAuth2 flow.
Application and entities that are used to describe audit logs on Discord.
Application and entities that are used to describe both DMs and guild channels on Discord.
Provides the python -m hikari
and hikari
commands to the shell.
Model that represents a common RGB color and provides simple conversions to other common color systems.
Alias for the hikari.colors
module.
Models and enums used for application commands on Discord.
Application and entities that are used to describe message embeds on Discord.
Application and entities that are used to describe emojis on Discord.
Exceptions and warnings that can be thrown by this library.
Events that can be fired by Hikari's gateway implementation.
Utilities and classes for interacting with files and web resources.
Application and entities that are used to describe guilds on Discord.
Basic implementations of application components …
Shard intents for controlling which events the application receives.
Models and enums related to Discord's interactions system.
Package containing internal utilities used within this API.
Application and entities that are used to describe invites on Discord.
Lazy iterators for data that requires repeated API calls to retrieve …
Enum of Discord accepted locales.
Application and entities that are used to describe messages on Discord.
Bitfield of permissions.
Application and entities that are used to describe guilds on Discord.
Application and entities that are used to describe guild scheduled events on Discord.
Entities directly related to creating and managing gateway shard sessions.
Implementation of a Snowflake type.
Application and entities that are used to describe stickers on Discord.
Application and entities that are used to describe guild templates on Discord.
Core app interface for application implementations.
Singleton used throughout the library to denote values that are not present.
API-wide URLs.
Application and entities that are used to describe Users on Discord.
Application and entities that are used to describe voice state on Discord.
Application and entities that are used to describe webhooks on Discord.
Represents a row of components attached to a message …
Represents a regular activity that can be associated with a presence …
Used to represent possible assets for an activity …
Flags that describe what an activity includes …
Used to represent activity groups of users …
The secrets used for interacting with an activity party …
The datetimes for the start and/or end of an activity session …
The activity type.
Helper that wraps predicates and invokes them together …
Represents the information of an Oauth2 Application …
The known application flag bits.
Represents an application webhook object on Discord …
Represents a file attached to a message …
A comparator that compares the result of a call with something else …
Represents a guilds audit log's page …
Represents a change made to an audit log entry's target entity …
Commonly known and documented keys for audit log change objects …
Represents an entry in a guild's audit log …
The type of event that occurred.
The application model found attached to AuthorizationInformation
…
Model for the data returned by Get Current Authorization Information …
Represents an autocomplete interaction on Discord …
Represents the options passed for a command autocomplete interaction …
Raised when you send an invalid request somehow …
Event that is fired when a user is banned from a guild …
Event that is fired when a user is unbanned from a guild …
Event base for any guild ban or unban …
A base object that all audit log entry info objects will inherit from …
Represents a base command interaction on Discord …
A special kind of lazy iterator that is used by internal components …
Exception raised when a bulk delete fails midway through a call …
Represents a message button component …
Enum of the available button styles …
Representation of in-memory data to upload …
Structural supertype for a cache-aware object …
Event base for any channel-bound event in guilds or private messages …
Relationship between a news channel and a subscriber channel …
Represents a channel follower webhook object on Discord …
Represents the extra information for overwrite related audit log entries …
The known channel types that are exposed to us by the API.
Strategy class for handling client credential OAuth2 authorization …
Base exception for an erroneous HTTP response that is a client error …
The client statuses for this member …
Representation of a color …
Representation of a color …
Represents the choices set for an application command's argument …
Represents a command interaction on Discord …
Represents the options passed for a command interaction …
Represents an application command's argument …
Representation of a permission which enables or disables a command for a user or role …
The type of entity a command permission targets.
The type of a command.
Represents a component interaction on Discord …
Exception thrown when an action cannot be executed in the component's current state …
Types of components found within Discord.
Describes who can see a connection with a third party account.
Represents a slash command on Discord …
Represents a custom emoji …
Represents a direct message text channel that is between you and another user …
Event base for any channel-bound event in private messages.
Event that is fired when a message is created within a DM …
Event that is triggered if a message is deleted in a DM …
Event that is fired when a message is updated in a DM …
Event fired when a message is pinned/unpinned in a private channel …
Event fired when a reaction is added to a private message …
Event fired when all of a private message's reactions are removed …
Event fired when an emoji is removed from a private message's reactions …
Event fired when a reaction is removed from a private message …
Event base for any reaction-bound event in private messages …
Event fired when a user starts typing in a guild channel …
Represents an embed.
Represents an author of an embed …
Represents a field in a embed …
Represents an embed image …
Represents an embed provider …
A base type for any resource provided in an embed …
Resource with a corresponding proxied element …
Represents an embed video …
Base class for all emojis …
Event that is fired when the emojis in a guild are updated …
Structural supertype for an entity factory-aware object …
Base event type that all Hikari events should subclass.
Structural supertype for an event factory-aware object …
Structural supertype for a event manager-aware object …
Enum of the possible scheduled event privacy levels.
Event that is raised when another event handler raises an Exception
…
An abstract class with logic for executing entities as webhooks.
Structural supertype for an executor-aware object …
A resource that exists on the local machine's storage to be uploaded …
A lazy iterator that has all items in-memory and ready …
Raised when you are not allowed to access a specific resource …
Basic auto-sharding bot implementation …
Structural supertype for a component that has all the gateway components.
Used to represent gateway information for the connected bot …
An exception thrown if a connection issue occurs …
A base exception type for anything that can be thrown by the Gateway …
Guild specialization that is sent via the gateway only …
An exception raised when the server closes the connection …
Represents a group direct message channel …
A representation of a guild on Discord …
Event fired when a guild becomes available …
Used to represent guild bans …
Event that is triggered when a bulk deletion is triggered in a guild …
Represents a guild category channel …
The base for anything that is a guild channel …
Event fired when a guild channel is created …
Event fired when a guild channel is deleted …
Event base for any channel-bound event in guilds …
Event fired when a guild channel is edited …
Representation of the permissions set for a command within a guild …
Event base for any guild-bound event …
Represents the explicit content filter setting for a guild.
Features that a guild can provide.
Event fired when the bot joins a new guild …
Event fired when the bot is banned/kicked/leaves a guild …
Represents the multi-factor authorization requirement for a guild.
Event that is fired when a message is created within a guild …
Event that is triggered if a message is deleted in a guild …
Represents the default notification level for new messages in a guild.
Event that is fired when a message is updated in a guild …
Represents the NSFW level of a guild.
Represents an news channel …
Event fired when a message is pinned/unpinned in a guild channel …
Tier for Discord Nitro boosting in a guild.
A preview of a guild with the DISCOVERABLE
feature …
Event fired when a reaction is added to a guild message …
Event fired when all of a guild message's reactions are removed …
Event fired when an emoji is removed from a guild message's reactions …
Event fired when a reaction is removed from a guild message …
Event base for any reaction-bound event in guild messages …
Represents a stage channel …
Represents a Discord sticker that belongs to a guild …
Defines which features are suppressed in the system channel.
Represents a guild text channel …
Event fired when a user starts typing in a guild channel …
Event fired when an existing guild is updated …
Represents the level of verification of a guild.
Event base for any event that changes the visibility of a guild …
Represents a voice channel …
Represents a guild widget …
Base exception raised if an HTTP error occurs while making a request …
Base exception for an erroneous HTTP response …
Base for an error raised by this API …
Exception raised when a kill signal is handled internally …
Base for a warning raised by this API …
Represents an incoming webhook object on Discord …
Represents a guild integration object …
An account that's linked to an integration …
An application that's linked to an integration …
Event that is fired when an integration is created in a guild …
Event that is fired when an integration is deleted in a guild …
Event base for any integration related events …
Behavior for expiring integration subscribers.
The integration type.
Event that is fired when an integration is updated in a guild …
Represents an intent on the gateway …
A component that is aware of the application intents.
Represents partial channels returned as resolved entities on interactions …
Event fired when an interaction is created …
Model of the member who triggered an interaction …
Structural supertype for a interaction REST server-aware object.
The type of an interaction.
Base exception for an erroneous HTTP response that is a server error …
Represents an invite that's used to add users to a guild or group dm …
A representation of a guild/channel invite.
Event fired when an invite is created in a channel …
Event fired when an invite is deleted from a channel …
Base event type for guild invite updates …
Represents the partial data of a guild that is attached to invites …
Extends the base Invite
object with metadata …
Represents an emoji that is known from a guild the bot is in …
A set of results that are fetched asynchronously from the API as needed …
Possible user/guild locales.
Used to represent a guild bound member …
Event fired when a member chunk payload is received on a gateway shard …
Event that is fired when a member joins a guild …
Event fired when a member is kicked from or leaves a guild …
Extra information for the voice chat member disconnect entry …
Event base for any events that concern guild members …
Extra information for the voice chat based member move entry …
Used to represent a guild member's presence …
Extra information attached to guild prune log entries …
Event that is fired when a member is updated in a guild …
Description of mentions that exist in the message …
Represents a message with all known details …
Represents the activity of a rich presence-enabled message …
The type of a rich presence message activity.
Extra information for the message bulk delete audit entry …
Event that is fired when a message is created …
Extra information attached to the message delete audit entry …
Special event that is triggered when a message gets deleted …
Any event that concerns manipulation of messages …
Additional flags for message options.
Representation of information provided for a message from an interaction …
The extra information for message pin related audit log entries …
Represents information about a referenced message …
Mixin' class for all interaction types which can be responded to with a message …
The type of a message.
Event that is fired when a message is updated …
Error raised when you try to perform an action without an intent …
Warning raised when subscribing to an event that cannot be fired …
Structural supertype for any component aware of network settings.
Raised when something is not found …
Model for the OAuth2 token data returned by the authorization grant flow …
Model for the OAuth2 token data returned by the implicit grant flow …
OAuth2 Scopes that Discord allows …
The type of a command option.
Represents a user's connection with a third party account …
Represents a user bound partial guild object …
Represents a user with extended OAuth2 information …
Event fired when the account user is updated …
A partial representation of a Discord application …
Channel representation for cases where further detail is not provided …
Represents any application command on Discord …
Base class for all component entities …
Base object for any partial guild objects …
A partial representation of an integration, found in audit logs …
The base model for all interaction models …
A message representation containing partially populated information …
Model for partial OAuth2 token data returned by the API …
Represents a partial guild bound Role object …
Represents the partial stickers found attached to messages on Discord …
A partial interface for a user …
Base class for all webhook implementations …
Represents permission overwrites for a channel or role in a channel …
The type of entity a Permission Overwrite targets.
Represents the permissions available in a given channel or guild …
Base event fired when a message is pinned/unpinned in a channel …
The types of Nitro.
Event fired when a user in a guild updates their presence in a guild …
The base for anything that is a private (non-guild bound) channel …
The base for a HTTP-only Discord application …
Structural supertype for a REST-aware object …
Basic implementation of an interaction based REST-only bot …
Structural supertype for a component that has all the RESTful components.
Guild specialization that is sent via the REST API only …
Internal error raised if the wait for a rate limit is too long …
Raised when a non-global rate limit that cannot be handled occurs …
Represents a reaction in a message …
Event base for any reaction that is added to a message …
Event base fired when all reactions are removed from a message …
Event base fired when all reactions are removed for one emoji …
Event base for any single reaction that is removed from a message …
Event base for any message reaction event …
Represents the resolved objects of entities referenced in a command's options …
The type of an interaction response.
Represents a rich activity that can be associated with a presence …
Represents a guild bound Role object …
Event fired when a role is created …
Event fired when a role is deleted …
Event base for any event that involves guild roles …
Event fired when a role is updated …
Structural super-type for an application which can be run independently.
Base class for scheduled events …
Event fired when a guild scheduled event is created …
Event fired when a guild scheduled event is deleted …
Event bassed for any scheduled event related events …
Enum of the scheduled event statuses.
Enum of the scheduled event types.
Event fired when a guild scheduled event is updated …
A user who is subscribed to a scheduled event …
Event fired when a user subscribes to a guild scheduled event …
Event fired when a user unsubscribes from a guild scheduled event …
A scheduled event that takes place outside of Discord …
A scheduled event that takes place in a stage channel …
A scheduled event that takes place in a voice channel …
Represents a message button component …
Represents an option for a SelectMenuComponent
…
Used to represent information about the current session start limits …
Structural supertype for a shard-aware object …
Reasons for a shard connection closure.
Event fired when a shard connects …
Event fired when a shard disconnects …
Base class for any event that was shard-specific.
Event fired for most shard events with their raw payload …
Event fired when a shard declares it is ready …
Event fired when a shard resumes an existing session …
Base class for any event concerning the state/connectivity of a shard …
Represents a slash command on Discord …
A concrete representation of a unique ID for an entity on Discord …
Represents a standard Discord sticker that belongs to a pack …
Event that is triggered after the application has started …
Event that is triggered before the application connects to discord …
The status of a member.
The formats types of a sticker's asset.
Represents a sticker pack on Discord …
The sticker type.
Event that is triggered once the application has disconnected …
Event that is triggered as soon as the application is requested to close …
The target of the invite.
Represents a development team, along with all its members …
Represents a member of a Team …
Represents the state of a user's team membership.
Represents a template used for creating guilds …
The partial guild object attached to Template
…
The partial role object attached to Template
…
Mixin class for a channel which can have text messages in it …
Mixin class for any guild channel which can have text messages in it …
Token types used within Hikari clients.
Base event fired when a user begins typing in a channel …
A URL that represents a web resource …
The type of the UNDEFINED
singleton sentinel value.
Represents a unicode emoji …
Mixin for a class that enforces uniqueness by a snowflake ID.
An exception thrown when an unrecognised entity is found …
Interface for any user-like object …
The known user flags that represent account badges.
A special case invite object, that represents a guild's vanity url …
The camera quality of the voice chat.
Structural supertype for a voice-aware object …
Error raised when a problem occurs with the voice subsystem.
Base for any voice-related event.
Represents a voice region server …
Event fired when a voice server is changed …
Represents a user's voice connection status …
Event fired when a user changes their voice state …
Types of webhook.
Event fired when a webhook is created/updated/deleted in a channel …
Used to represent channels on guild welcome screens …
Used to represent guild welcome screens on Discord …