HTTP#
Important
This page shows internal functions that you should not use unless you know how to use them. Most of these functions should have their own implementation in the different Models of the library.
Because this page is showcasing internal functions the
versionadded
,deprecated
andversionchanged
markers will not be added.
- class interactions.api.http.route.Route(method, path, **kwargs)[source]
A class representing how an HTTP route is structured.
- Variables:
- get_bucket(shared_bucket=None)[source]
Returns the route’s bucket. If shared_bucket is None, returns the path with major parameters. Otherwise, it relies on Discord’s given bucket.
- class interactions.api.http.limiter.Limiter(*, lock, reset_after=<interactions.MISSING>)[source]
A class representing a limitation for an HTTP request.
- Variables:
lock (Lock) – The “lock” or controller of the request.
reset_after (float) – The remaining time before the request can be ran.
- class interactions.api.http.request._Request(token)[source]
A class representing how HTTP requests are sent/read.
- Variables:
token (str) – The current application token.
_loop (AbstractEventLoop) – The current coroutine event loop.
ratelimits (Dict[str, Limiter]) – The current per-route rate limiters from the API.
buckets (Dict[str, str]) – The current endpoint to shared_bucket cache from the API.
_headers (dict) – The current headers for an HTTP request.
_session (ClientSession) – The current session for making requests.
_global_lock (Limiter) – The global rate limiter.
- async request(route, **kwargs)[source]
Sends a request to the Discord API.
- Parameters:
route (Route) – The HTTP route to request.
**kwargs? (dict) – Optional keyword-only arguments to pass as information in the request.
- Returns:
The contents of the request if any.
- Return type:
Optional[Any]
- async close()[source]
Closes the current session.
- class interactions.api.http.client.HTTPClient(token, cache)[source]
The user-facing client of the Web API for individual endpoints.
- Variables:
token (str) – The token of the application.
_req (Request) – The requesting interface for endpoints.
cache (Cache) – The referenced cache.
- async get_gateway()[source]
This calls the Gateway endpoint and returns a v9 gateway link with JSON encoding.
- Return type:
- async get_bot_gateway()[source]
This calls the BOT Gateway endpoint.
- async login()[source]
This ‘logins’ to the gateway, which makes it available to use any other endpoint.
- Return type:
dict | None
- async logout()[source]
This ‘log outs’ the session.
- async get_current_bot_information()[source]
Returns the bot user application object without flags.
- Return type:
- async add_guild_member(guild_id, user_id, access_token, nick=None, roles=None, mute=None, deaf=None)
A low level method of adding a user to a guild with pre-defined attributes.
- Parameters:
guild_id (int) – Guild ID snowflake.
user_id (int) – User ID snowflake.
access_token (str) – User access token.
nick (str | None) – User’s nickname on join.
roles (List[Role] | None) – An array of roles that the user is assigned.
mute (bool | None) – Whether the user is mute in voice channels.
deaf (bool | None) – Whether the user is deafened in voice channels.
- Returns:
Guild member object as dictionary
- Return type:
- async add_member_role(guild_id, user_id, role_id, reason=None)
Adds a role to a guild member.
- async add_member_to_thread(thread_id, user_id)
Add another user to a thread.
- async begin_guild_prune(guild_id, days=7, compute_prune_count=True, include_roles=None)
Begins a prune operation.
- Parameters:
- Returns:
A dict containing {“pruned”: int} or {“pruned”: None}
- Return type:
- async create_application_command(application_id, data, guild_id=None)
Registers to the Discord API an application command.
- async create_auto_moderation_rule(guild_id, name, event_type, trigger_type, actions, trigger_metadata=None, enabled=False, exempt_roles=None, exempt_channels=None, reason=None)
Create a new AutoMod rule in a guild.
- Parameters:
guild_id (int) – Guild ID snowflake.
name (str) – The name of the new rule.
event_type (int) – The event type of the new rule.
trigger_type (int) – The trigger type of the new rule.
trigger_metadata (dict | None) – The trigger metadata payload representation. This can be omitted based on the trigger type.
actions (List[dict]) – The actions that will execute when the rule is triggered.
enabled (bool | None) – Whether the rule will be enabled upon creation. False by default.
exempt_roles (List[str] | None) – The role IDs that are whitelisted by the rule, if given. The maximum is 20.
exempt_channels (List[str] | None) – The channel IDs that are whitelisted by the rule, if given. The maximum is 20
reason (str | None) – Reason to send to audit log, if any.
- Returns:
A dictionary containing the new automod rule.
- Return type:
- async create_channel(guild_id, payload, reason=None)
Creates a channel within a guild.
Note
This does not handle payload in this method. Tread carefully.
- async create_channel_invite(channel_id, payload, reason=None)
Creates an invite for the given channel.
Note
This method does not handle payload. It just sends it.
- async create_dm(recipient_id)
Creates a new DM channel with a user.
- async create_guild_ban(guild_id, user_id, delete_message_seconds=0, reason=None)
Bans a person from the guild, and optionally deletes previous messages sent by them.
- async create_guild_emoji(guild_id, payload, reason=None)
Creates an emoji.
- async create_guild_from_guild_template(template_code, name, icon=None)
Create a new guild based on a template.
Note
This endpoint can only be used by bots in less than 10 guilds.
- async create_guild_kick(guild_id, user_id, reason=None)
Kicks a person from the guild.
- async create_guild_role(guild_id, payload, reason=None)
Create a new role for the guild.
- async create_guild_sticker(payload, file, guild_id, reason=None)
Create a new sticker for the guild. Requires the MANAGE_EMOJIS_AND_STICKERS permission.
- async create_guild_template(guild_id, name, description=None)
Create a guild template for the guild.
- async create_interaction_response(token, application_id, data, files=None)
Posts initial response to an interaction, but you need to add the token.
- async create_message(payload, channel_id, files=<interactions.MISSING>)
Send a message to the specified channel.
- async create_reaction(channel_id, message_id, emoji)
Create a reaction for a message.
- async create_scheduled_event(guild_id, payload)
Creates a scheduled event.
- async create_stage_instance(channel_id, topic, privacy_level=1, reason=None)
Create a new stage instance.
- Parameters:
- Returns:
The new stage instance
- Return type:
- async create_tag(channel_id, name, moderated=False, emoji_id=None, emoji_name=None, reason=None)
Create a new tag.
Note
Can either have an emoji_id or an emoji_name, but not both. emoji_id is meant for custom emojis, emoji_name is meant for unicode emojis.
- Parameters:
channel_id (int) – Channel ID snowflake.
name (str) – The name of the tag
moderated (bool) – Whether the tag can only be assigned to moderators or not. Defaults to
False
emoji_id (int | None) – The ID of the emoji to use for the tag
emoji_name (str | None) – The name of the emoji to use for the tag
reason (str | None) – The reason for the creating the tag, if any.
- Returns:
A Forum tag.
- Return type:
- async create_thread(channel_id, name, thread_type=None, auto_archive_duration=None, invitable=None, message_id=None, reason=None)
From a given channel, create a Thread with an optional message to start with.
- Parameters:
channel_id (int) – The ID of the channel to create this thread in
name (str) – The name of the thread
auto_archive_duration (int | None) – duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080
thread_type (int | None) – The type of thread, defaults to public. ignored if creating thread from a message
invitable (bool | None) – Boolean to display if the Thread is open to join or private.
message_id (int | None) – An optional message to create a thread from.
reason (str | None) – An optional reason for the audit log
- Returns:
The created thread
- Return type:
- async create_thread_in_forum(channel_id, name, auto_archive_duration, message, applied_tags=None, files=<interactions.MISSING>, rate_limit_per_user=None, reason=None)
From a given Forum channel, create a Thread with a message to start with.
- Parameters:
channel_id (int) – The ID of the channel to create this thread in
name (str) – The name of the thread
auto_archive_duration (int) – duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080
message (dict) – The payload/dictionary contents of the first message in the forum thread.
applied_tags (List[str] | None) – List of tag ids that can be applied to the forum, if any.
files (List[File] | None) – An optional list of files to send attached to the message.
rate_limit_per_user (int | None) – Seconds a user has to wait before sending another message (0 to 21600), if given.
reason (str | None) – An optional reason for the audit log
- Returns:
Returns a Thread in a Forum object with a starting Message.
- Return type:
- async create_webhook(channel_id, name, avatar=None)
Create a new webhook.
- async delete_application_command(application_id, command_id, guild_id=None)
Deletes an application command.
- async delete_auto_moderation_rule(guild_id, rule_id, reason=None)
Deletes an AutoMod rule. :param guild_id: Guild ID snowflake. :param rule_id: Rule ID snowflake. :param reason: Reason to send to audit log, if any.
- async delete_channel(channel_id)
Deletes a channel.
- Parameters:
channel_id (int) – Channel ID snowflake
- async delete_channel_permission(channel_id, overwrite_id, reason=None)
Deletes a channel permission overwrite for a user or role in a channel.
- async delete_guild(guild_id)
Deletes a guild.
- Parameters:
guild_id (int) – Guild ID snowflake.
- async delete_guild_emoji(guild_id, emoji_id, reason=None)
Deletes an emoji.
- async delete_guild_integration(guild_id, integration_id)
Deletes an integration from the guild.
- async delete_guild_role(guild_id, role_id, reason=None)
Delete a guild role.
- async delete_guild_sticker(guild_id, sticker_id, reason=None)
Delete the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission.
- async delete_guild_template(guild_id, template_code)
Delete the guild template.
- async delete_interaction_response(token, application_id, message_id='@original')
Deletes an existing interaction message.
- async delete_invite(invite_code, reason=None)
Delete an invite.
- async delete_message(channel_id, message_id, reason=None)
Deletes a message from a specified channel.
- async delete_messages(channel_id, message_ids, reason=None)
Deletes messages from a specified channel.
- async delete_original_webhook_message(webhook_id, webhook_token)
Deletes the original message object sent.
- async delete_scheduled_event(guild_id, guild_scheduled_event_id)
Deletes a guild scheduled event.
- async delete_stage_instance(channel_id, reason=None)
Delete a stage instance.
- async delete_tag(channel_id, tag_id, reason=None)
Delete a forum tag.
- async delete_webhook(webhook_id, webhook_token=None)
Delete a webhook.
- async delete_webhook_message(webhook_id, webhook_token, message_id)
Deletes a message object.
- async edit_application_command(application_id, data, command_id, guild_id=None)
Edits an application command.
- Parameters:
- Returns:
The updated application command object.
- Return type:
- async edit_application_command_permissions(application_id, guild_id, command_id, data)
Edits permissions for an application command.
Note
This requires authenticating with the Bearer token. Likewise, if this function is used in a bot process with a bot token, this will fail.
- async edit_channel_permission(channel_id, overwrite_id, allow, deny, perm_type, reason=None)
Edits the channel’s permission overwrites for a user or role in a given channel.
- Parameters:
channel_id (int) – Channel ID snowflake.
overwrite_id (int) – The ID of the overridden object.
allow (str) – the bitwise value of all allowed permissions
deny (str) – the bitwise value of all disallowed permissions
perm_type (int) – 0 for a role or 1 for a member
reason (str | None) – Reason to display in the Audit Log, if given.
- async edit_interaction_response(data, token, application_id, files=None, message_id='@original')
Edits an existing interaction message, but token needs to be manually called.
- Parameters:
- Returns:
Updated message data.
- Return type:
- async edit_message(channel_id, message_id, payload, files=<interactions.MISSING>)
Edits a message that already exists.
- Parameters:
- Returns:
A message object with edited attributes.
- Return type:
- async edit_tag(channel_id, tag_id, name, moderated=None, emoji_id=None, emoji_name=None, reason=None)
Update a tag.
Note
Can either have an emoji_id or an emoji_name, but not both. emoji_id is meant for custom emojis, emoji_name is meant for unicode emojis.
The object returns will have a different tag ID.
- Parameters:
channel_id (int) – Channel ID snowflake.
tag_id (int) – The ID of the tag to update.
moderated (bool | None) – Whether the tag can only be assigned to moderators or not. Defaults to
False
name (str) – The new name of the tag
emoji_id (int | None) – The ID of the emoji to use for the tag
emoji_name (str | None) – The name of the emoji to use for the tag
reason (str | None) – The reason for deleting the tag, if any.
- Return type:
:return The updated tag object.
- async edit_webhook_message(webhook_id, webhook_token, message_id, data)
Edits a message sent from a Webhook.
- async execute_github_webhook(webhook_id, webhook_token, payload)
Sends a message to a Github-compatible webhook.
- Parameters:
- Returns:
?
- Return type:
None
Note
Payload structure is different than Discord’s. See here <https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook>_ for more details.
- async execute_slack_webhook(webhook_id, webhook_token, payload)
Sends a message to a Slack-compatible webhook.
- Parameters:
- Returns:
?
- Return type:
None
Note
Payload structure is different than Discord’s. See here <https://api.slack.com/messaging/webhooks>_ for more details.
- async execute_webhook(webhook_id, webhook_token, payload, files=<interactions.MISSING>, wait=False, thread_id=None)
Sends a message as a webhook.
- Parameters:
webhook_id (int) – Webhook ID snowflake.
webhook_token (str) – The token for the webhook.
payload (dict) – Payload consisting of the message.
files (List[File] | None) – The files to upload to the message.
wait (bool | None) – A bool that signifies waiting for server confirmation of a send before responding.
thread_id (int | None) – Optional, sends a message to the specified thread.
- Returns:
The message sent, if wait=True, else None.
- Return type:
dict | None
- async get_all_application_command_permissions(application_id, guild_id)
Gets, from the Discord API, permissions from all Application commands at that Guild.
- async get_all_channels(guild_id)
Requests from the API to get all channels in the guild.
- async get_all_emoji(guild_id)
Gets all emojis from a guild.
- async get_all_roles(guild_id)
Gets all roles from a Guild.
- async get_application_command_permissions(application_id, guild_id, command_id)
Gets, from the Discord API, permissions from a specific Guild application command.
- async get_application_commands(application_id, guild_id=None, with_localizations=None)
Get all application commands from an application.
- Parameters:
guild_id (int | None) – Guild to get commands from, if specified. Defaults to global (None)
with_localizations (bool | None) – Whether to include full localization dictionaries (name_localizations and description_localizations) in the returned objects, instead of the name_localized and description_localized fields. Default false.
- Returns:
A list of Application commands.
- Return type:
- async get_auto_moderation_rule(guild_id, rule_id)
Get a single AutoMod rule in a guild. :param guild_id: Guild ID snowflake. :param rule_id: Rule ID snowflake. :return: A dictionary containing the automod rule.
- Return type:
- async get_channel(channel_id)
Gets a channel by ID. If the channel is a thread, it also includes thread members (and other thread attributes).
- async get_channel_invites(channel_id)
Get the invites for the channel.
- async get_channel_messages(channel_id, limit=50, around=None, before=None, after=None)
Get messages from a channel.
Note
around, before, and after arguments are mutually exclusive.
- Parameters:
- Returns:
An array of Message objects.
- Return type:
- async get_channel_webhooks(channel_id)
Return a list of channel webhook objects.
- async get_current_authorisation_information()[source]
Returns info about the current authorization of the bot user
- Return type:
- async get_guild(guild_id, with_counts=False)
Requests an individual guild from the API.
- async get_guild_auditlog(guild_id, user_id=None, action_type=None, before=None, limit=50)
Returns an audit log object for the guild. Requires the ‘VIEW_AUDIT_LOG’ permission. :param guild_id: Guild ID snowflake. :param user_id: User ID snowflake. filter the log for actions made by a user. :param action_type: the type ID of audit log event. :param before: filter the log before a certain entry id. :param limit: how many entries are returned (default 50, minimum 1, maximum 100)
- Return type:
- async get_guild_bans(guild_id, limit=1000, before=None, after=None)
Gets a list of banned users.
Note
If both
before
andafter
are provided, onlybefore
is respected.- Parameters:
- Returns:
A list of banned users.
- Return type:
- async get_guild_emoji(guild_id, emoji_id)
Gets an emote from a guild.
- async get_guild_integrations(guild_id)
Gets a list of integration objects associated with the Guild from the API.
- async get_guild_invites(guild_id)
Retrieves a list of invite objects with their own metadata.
- async get_guild_preview(guild_id)
Get a guild’s preview.
- async get_guild_prune_count(guild_id, days=7, include_roles=None)
Retrieves a dict from an API that results in how many members would be pruned given the amount of days.
- async get_guild_sticker(guild_id, sticker_id)
Get a sticker from a guild.
- async get_guild_template(template_code)
New in version 4.4.0.
Returns a guild template.
- async get_guild_templates(guild_id)
Returns an array of guild templates.
- async get_guild_webhooks(guild_id)
Return a list of guild webhook objects.
- async get_guild_welcome_screen(guild_id)
Retrieves from the API a welcome screen associated with the guild.
- async get_guild_widget(guild_id)
Returns the widget for the guild.
- async get_guild_widget_image(guild_id, style=None)
Get an url representing a png image widget for the guild.
Note
See _<https://discord.com/developers/docs/resources/guild#get-guild-widget-image> for list of styles.
- async get_guild_widget_settings(guild_id)
Get guild widget settings.
- async get_invite(invite_code, with_counts=None, with_expiration=None, guild_scheduled_event_id=None)
Gets a Discord invite using its code.
- Parameters:
invite_code (str) – A string representing the invite code.
with_counts (bool | None) – Whether approximate_member_count and approximate_presence_count are returned.
with_expiration (bool | None) – Whether the invite’s expiration date is returned.
guild_scheduled_event_id (int | None) – A guild scheduled event’s ID.
- Return type:
- async get_list_of_members(guild_id, limit=1, after=None)
Lists the members of a guild.
- async get_member(guild_id, member_id)
Uses the API to fetch a member from a guild.
- async get_member_from_thread(thread_id, user_id)
Get a member from a thread.
- async get_message(channel_id, message_id)
Get a specific message in the channel.
- async get_original_interaction_response(token, application_id, message_id='@original')
Gets an existing interaction message.
- async get_pinned_messages(channel_id)
Get all pinned messages from a channel.
- async get_reactions_of_emoji(channel_id, message_id, emoji, limit=25, after=None)
Gets the users who reacted to the emoji.
- Parameters:
- Returns:
A list of users who sent that emoji.
- Return type:
- async get_scheduled_event(guild_id, guild_scheduled_event_id, with_user_count)
Gets a guild scheduled event.
- Parameters:
- Returns:
A dictionary containing the guild scheduled event object on success.
- Return type:
- async get_scheduled_event_users(guild_id, guild_scheduled_event_id, limit=100, with_member=False, before=None, after=None)
Get the registered users of a scheduled event.
- Parameters:
guild_id (int) – Guild ID snowflake.
guild_scheduled_event_id (int) – Guild Scheduled Event snowflake.
limit (int) – Limit of how many users to pull from the event. Defaults to 100.
with_member (bool) – Include guild member data if it exists. Defaults to False.
before (int | None) – Considers only users before given user ID snowflake. Defaults to None.
after (int | None) – Considers only users after given user ID snowflake. Defaults to None.
- Returns:
Returns a list of guild scheduled event user objects on success.
- Return type:
- async get_scheduled_events(guild_id, with_user_count)
Gets all guild scheduled events in a guild.
- async get_self()
An alias to get_user, but only gets the current bot user.
- Returns:
A partial User object of the current bot user in the form of a dictionary.
- Return type:
- async get_self_guilds(limit=200, before=None, after=None)
Gets all guild objects associated with the current bot user.
- Parameters:
- Returns:
A list of partial guild objects the current bot user is a part of.
- Return type:
- async get_stage_instance(channel_id)
Get the stage instance associated with a given channel, if it exists.
- async get_sticker(sticker_id)
Get a specific sticker.
- async get_user(user_id=None)
Gets a user object for a given user ID.
- async get_user_ban(guild_id, user_id)
Gets an object pertaining to the user, if it exists. Returns a 404 if it doesn’t.
- async get_webhook(webhook_id, webhook_token=None)
Return the new webhook object for the given id.
- Parameters:
- Return type:
:return:Webhook object
- async get_webhook_message(webhook_id, webhook_token, message_id)
Retrieves a message sent from a Webhook.
- async join_thread(thread_id)
Have the bot user join a thread.
- Parameters:
thread_id (int) – The thread to join.
- async leave_guild(guild_id)
Leaves a guild.
- Parameters:
guild_id (int) – The guild snowflake ID associated.
- Returns:
None
- Return type:
None
- async leave_thread(thread_id)
Have the bot user leave a thread.
- Parameters:
thread_id (int) – The thread to leave.
- async list_active_threads(guild_id)
List active threads within a guild.
- async list_auto_moderation_rules(guild_id)
Returns a list of all AutoMod rules in a guild. :poram guild_id: Guild ID snowflake. :return: A list of dictionaries containing the automod rules.
- async list_guild_stickers(guild_id)
Get the stickers for a guild.
- async list_joined_private_archived_threads(channel_id, limit=None, before=None)
Get a list of archived private threads in a channel that the bot has joined.
- async list_nitro_sticker_packs()
Gets the list of sticker packs available to Nitro subscribers.
- async list_private_archived_threads(channel_id, limit=None, before=None)
Get a list of archived private threads in a channel.
- async list_public_archived_threads(channel_id, limit=None, before=None)
Get a list of archived public threads in a given channel.
- async list_thread_members(thread_id)
Get a list of members in the thread.
- async modify_auto_moderation_rule(guild_id, rule_id, name=None, event_type=None, trigger_metadata=None, actions=None, enabled=None, exempt_roles=None, exempt_channels=None, reason=None)
Modify an existing AutoMod rule in a guild.
Note
All parameters besides guild and rule ID are optional.
- Parameters:
guild_id (int) – Guild ID snowflake.
rule_id (int) – Rule ID snowflake.
name (str | None) – The new name of the rule.
event_type (int | None) – The new event type of the rule.
trigger_metadata (dict | None) – The new trigger metadata payload representation. This can be omitted based on the trigger type.
actions (List[dict] | None) – The new actions that will execute when the rule is triggered.
enabled (bool | None) – Whether the rule will be enabled upon creation.
exempt_roles (List[str] | None) – The role IDs that are whitelisted by the rule, if given. The maximum is 20.
exempt_channels (List[str] | None) – The channel IDs that are whitelisted by the rule, if given. The maximum is 20
reason (str | None) – Reason to send to audit log, if any.
- Returns:
A dictionary containing the updated automod rule.
- Return type:
- async modify_channel(channel_id, payload, reason=None)
Update a channel’s settings.
- async modify_current_user_voice_state(guild_id, channel_id, suppress=None, request_to_speak_timestamp=None)
Update the current user voice state.
- async modify_guild(guild_id, payload, reason=None)
Modifies a guild’s attributes.
- async modify_guild_emoji(guild_id, emoji_id, payload, reason=None)
Modifies an emoji.
- async modify_guild_role(guild_id, role_id, payload, reason=None)
Modify a given role for the guild.
- async modify_guild_role_positions(guild_id, payload, reason=None)
Modify the position of a role in the guild.
- async modify_guild_sticker(payload, guild_id, sticker_id, reason=None)
Modify the given sticker. Requires the MANAGE_EMOJIS_AND_STICKERS permission.
- async modify_guild_template(guild_id, template_code, name=None, description=None)
Modify a guild template.
- async modify_guild_welcome_screen(guild_id, enabled, welcome_channels, description)
Modify the guild’s welcome screen.
- Parameters:
- Returns:
Updated Welcome screen object.
- Return type:
- async modify_guild_widget(guild_id, payload)
Modify a guild widget.
- async modify_member(user_id, guild_id, payload, reason=None)
Edits a member. This can nick them, change their roles, mute/deafen (and its contrary), and moving them across channels and/or disconnect them.
- async modify_scheduled_event(guild_id, guild_scheduled_event_id, payload)
Modifies a scheduled event.
- Parameters:
- Returns:
A dictionary containing the updated guild scheduled event object on success.
- Return type:
- async modify_self(payload)
Modify the bot user account settings.
- async modify_self_nick_in_guild(guild_id, nickname)
Changes a nickname of the current bot user in a guild.
- async modify_stage_instance(channel_id, topic=None, privacy_level=None, reason=None)
Update the fields of a given stage instance.
- Parameters:
- Returns:
The updated stage instance.
- Return type:
- async modify_user_voice_state(guild_id, user_id, channel_id, suppress=None)
Modify the voice state of a user.
- async modify_webhook(webhook_id, payload, webhook_token=None)
Modify a webhook.
- async move_channel(guild_id, channel_id, new_pos, parent_id, lock_perms=False, reason=None)
Moves a channel to a new position.
- Parameters:
guild_id (int) – Guild ID snowflake.
channel_id (int) – Channel ID snowflake.
new_pos (int) – The new channel position.
parent_id (int | None) – The category parent ID, if needed.
lock_perms (bool) – Sync permissions with the parent associated with parent_id. Defaults to False.
reason (str | None) – Reason to display to the audit log, if any.
- Returns:
?
- Return type:
- async overwrite_application_command(application_id, data, guild_id=None)
Overwrites application command(s) from a scope to the new, updated commands.
Note
This applies to all forms of application commands (slash and context menus)
- async pin_message(channel_id, message_id)
Pin a message to a channel.
- async publish_message(channel_id, message_id)
Publishes (API calls it crossposts) a message in a News channel to any that is followed by.
- async remove_all_reactions(channel_id, message_id)
Remove all reactions from a message.
- async remove_all_reactions_of_emoji(channel_id, message_id, emoji)
Remove all reactions of a certain emoji from a message.
- async remove_guild_ban(guild_id, user_id, reason=None)
Unbans someone using the API.
- async remove_guild_member(guild_id, user_id, reason=None)
A low level method of removing a member from a guild. This is different from banning them.
- async remove_member_from_thread(thread_id, user_id)
Remove another user from a thread.
- async remove_member_role(guild_id, user_id, role_id, reason=None)
Removes a role to a guild member.
- async remove_self_reaction(channel_id, message_id, emoji)
Remove bot user’s reaction from a message.
- async remove_user_reaction(channel_id, message_id, emoji, user_id)
Remove user’s reaction from a message.
- async search_guild_members(guild_id, query, limit=1)
Search a guild for members whose username or nickname starts with provided string.
- async send_message(channel_id, content, tts=False, embeds=None, nonce=None, allowed_mentions=None, message_reference=None, stickers=None)
A higher level implementation of
create_message()
that handles the payload dict internally. Does not integrate components into the function, and is a port from v3.0.0- Return type:
- async sync_guild_template(guild_id, template_code)
Sync the template to the guild’s current state.
- async trigger_typing(channel_id)
Posts “… is typing” in a given channel.
Note
By default, this lib doesn’t use this endpoint, however, this is listed for third-party implementation.
- Parameters:
channel_id (int) – Channel ID snowflake.
- async unpin_message(channel_id, message_id)
Unpin a message to a channel.
- async get_application_role_connection_metadata(application_id)[source]
Returns a list of application role connection metadata objects for an application.