Bot Client#

class interactions.client.bot.Client(token, **kwargs)#

A class representing the client connection to Discord’s gateway and API via. WebSocket and HTTP.

Parameters:
  • token (str) – The token of the application for authentication and connection.

  • intents? (Optional[Intents]) – Allows specific control of permissions the application has when connected. In order to use multiple intents, the | operator is recommended. Defaults to Intents.DEFAULT.

  • shards? (Optional[List[Tuple[int]]]) – Dictates and controls the shards that the application connects under.

  • presence? (Optional[ClientPresence]) – Sets an RPC-like presence on the application when connected to the Gateway.

  • default_scope? (Optional[Union[int, Guild, List[int], List[Guild]]]) – Sets the default scope of all commands.

  • disable_sync? (Optional[bool]) – Controls whether synchronization in the user-facing API should be automatic or not.

  • logging? (Optional[Union[bool, logging.DEBUG, logging.INFO, logging.NOTSET, logging.WARNING, logging.ERROR, logging.CRITICAL]]) – Set to True to enable debug logging or set to a log level to use a specific level

Variables:
  • _loop (AbstractEventLoop) – The asynchronous event loop of the client.

  • _http (HTTPClient) – The user-facing HTTP connection to the Web API, as its own separate client.

  • _websocket (WebSocketClient) – An object-orientation of a websocket server connection to the Gateway.

  • _intents (Intents) – The Gateway intents of the application. Defaults to Intents.DEFAULT.

  • _shard (Optional[List[Tuple[int]]]) – The list of bucketed shards for the application’s connection.

  • _presence (Optional[ClientPresence]) – The RPC-like presence shown on an application once connected.

  • _token (str) – The token of the application used for authentication when connecting.

  • _extensions (Optional[Dict[str, ModuleType]]) – The “extensions” or cog equivalence registered to the main client.

  • me? (Application) – The application representation of the client.

property guilds: List[Guild]#

Returns a list of guilds the bot is in.

property latency: float#

Returns the connection latency in milliseconds.

start()#

Starts the client session.

Return type:

None

async __compare_sync(pool)#

Compares an application command during the synchronization process.

Parameters:
  • data (dict) – The application command to compare.

  • pool (List[dict]) – The “pool” or list of commands to compare from.

Returns:

Whether the command has changed or not.

Return type:

bool

async _ready()#

Prepares the client with an internal “ready” check to ensure that all conditions have been met in a chronological order:

CLIENT START
|___ GATEWAY
|   |___ READY
|   |___ DISPATCH
|___ SYNCHRONIZE
|   |___ CACHE
|___ DETECT DECORATOR
|   |___ BUILD MODEL
|   |___ SYNCHRONIZE
|   |___ CALLBACK
LOOP
Return type:

None

async _stop()#

Stops the websocket connection gracefully.

Return type:

None

async _login()#

Makes a login with the Discord API.

Return type:

None

async wait_until_ready()#

Helper method that waits until the websocket is ready.

Return type:

None

__resolve_commands()#

Resolves all commands to the command coroutines.

Warning

This is an internal method. Do not call it unless you know what you are doing!

Return type:

None

async __sync()#

Synchronizes all commands to the API.

Warning

This is an internal method. Do not call it unless you know what you are doing!

Return type:

None

event(coro=<interactions.MISSING>, *, name=<interactions.MISSING>)#

A decorator for listening to events dispatched from the Gateway.

Parameters:
  • coro (Optional[Callable[..., Coroutine]]) – The coroutine of the event.

  • name(?) – The name of the event. If not given, this defaults to the coroutine’s name.

  • name (Optional[str]) –

Returns:

A callable response.

Return type:

Callable[…, Any]

async change_presence(presence)#

A method that changes the current client’s presence on runtime.

Note

There is a ratelimit to using this method (5 per minute). As there’s no gateway ratelimiter yet, breaking this ratelimit will force your bot to disconnect.

Parameters:

presence (ClientPresence) – The presence to change the bot to on identify.

Return type:

None

__check_command(command, coro, regex='^[a-z0-9_-]{1,32}$')#

Checks if a command is valid.

Parameters:
Return type:

None

command(*, type=ApplicationCommandType.CHAT_INPUT, name=<interactions.MISSING>, description=<interactions.MISSING>, scope=<interactions.MISSING>, options=<interactions.MISSING>, name_localizations=<interactions.MISSING>, description_localizations=<interactions.MISSING>, default_member_permissions=<interactions.MISSING>, dm_permission=<interactions.MISSING>, default_scope=True)#

A decorator for registering an application command to the Discord API, as well as being able to listen for INTERACTION_CREATE dispatched gateway events.

The structure of a chat-input command:

@command(name="command-name", description="this is a command.")
async def command_name(ctx):
    ...

You are also able to establish it as a message or user command by simply passing the type kwarg field into the decorator:

@command(type=interactions.ApplicationCommandType.MESSAGE, name="Message Command")
async def message_command(ctx):
    ...

The scope kwarg field may also be used to designate the command in question applicable to a guild or set of guilds.

To properly utilise the default_member_permissions kwarg, it requires OR’ing the permission values, similar to instantiating the client with Intents. For example:

@command(name="kick", description="Kick a user.", default_member_permissions=interactions.Permissions.BAN_MEMBERS | interactions.Permissions.KICK_MEMBERS)
async def kick(ctx, user: interactions.Member):
    ...

Another example below for instance is an admin-only command:

@command(name="sudo", description="this is an admin-only command.", default_member_permissions=interactions.Permissions.ADMINISTRATOR)
async def sudo(ctx):
    ...

Note

If default_member_permissions is not given, this will default to anyone that is able to use the command.

Parameters:
  • type? (Optional[Union[str, int, ApplicationCommandType]]) – The type of application command. Defaults to interactions.enums.ApplicationCommandType.CHAT_INPUT() or 1.

  • name (Optional[str]) – The name of the application command. This is required but kept optional to follow kwarg rules.

  • description? (Optional[str]) – The description of the application command. This should be left blank if you are not using CHAT_INPUT.

  • scope? (Optional[Union[int, Guild, List[int], List[Guild]]]) – The “scope”/applicable guilds the application command applies to.

  • options? (Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]]) – The “arguments”/options of an application command. This should be left blank if you are not using CHAT_INPUT.

  • name_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the name field. This enforces the same restrictions as the name field.

  • description_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the description field. This enforces the same restrictions as the description field.

  • default_member_permissions? (Optional[Union[int, Permissions]]) – The permissions bit value of interactions.api.model.flags.Permissions. If not given, defaults to interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS() or 2147483648

  • dm_permission? (Optional[bool]) – The application permissions if executed in a Direct Message. Defaults to True.

  • default_scope? (bool) – Whether the scope of the command is the default scope set in the client. Defaults to True.

  • type (Optional[Union[int, ApplicationCommandType]]) –

  • description (Optional[str]) –

  • scope (Optional[Union[int, Guild, List[int], List[Guild]]]) –

  • options (Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]]) –

  • name_localizations (Optional[Dict[Union[str, Locale], str]]) –

  • description_localizations (Optional[Dict[Union[str, Locale], str]]) –

  • default_member_permissions (Optional[Union[int, Permissions]]) –

  • dm_permission (Optional[bool]) –

  • default_scope (bool) –

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Command]

message_command(*, name=<interactions.MISSING>, scope=<interactions.MISSING>, name_localizations=<interactions.MISSING>, default_member_permissions=<interactions.MISSING>, dm_permission=<interactions.MISSING>, default_scope=True)#

A decorator for registering a message context menu to the Discord API, as well as being able to listen for INTERACTION_CREATE dispatched gateway events.

The structure of a message context menu:

@message_command(name="Context menu name")
async def context_menu_name(ctx):
    ...

The scope kwarg field may also be used to designate the command in question applicable to a guild or set of guilds.

Parameters:
  • name (Optional[str]) – The name of the application command.

  • scope? (Optional[Union[int, Guild, List[int], List[Guild]]]) – The “scope”/applicable guilds the application command applies to. Defaults to None.

  • default_permission? (Optional[bool]) – The default permission of accessibility for the application command. Defaults to True.

  • name_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the name field. This enforces the same restrictions as the name field.

  • default_member_permissions? (Optional[Union[int, Permissions]]) – The permissions bit value of interactions.api.model.flags.Permissions. If not given, defaults to interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS() or 2147483648

  • dm_permission? (Optional[bool]) – The application permissions if executed in a Direct Message. Defaults to True.

  • default_scope? (bool) – Whether the scope of the command is the default scope set in the client. Defaults to True.

  • scope (Optional[Union[int, Guild, List[int], List[Guild]]]) –

  • name_localizations (Optional[Dict[Union[str, Locale], Any]]) –

  • default_member_permissions (Optional[Union[int, Permissions]]) –

  • dm_permission (Optional[bool]) –

  • default_scope (bool) –

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Command]

user_command(*, name=<interactions.MISSING>, scope=<interactions.MISSING>, name_localizations=<interactions.MISSING>, default_member_permissions=<interactions.MISSING>, dm_permission=<interactions.MISSING>, default_scope=True)#

A decorator for registering a user context menu to the Discord API, as well as being able to listen for INTERACTION_CREATE dispatched gateway events.

The structure of a user context menu:

@user_command(name="Context menu name")
async def context_menu_name(ctx):
    ...

The scope kwarg field may also be used to designate the command in question applicable to a guild or set of guilds.

Parameters:
  • name (Optional[str]) – The name of the application command.

  • scope? (Optional[Union[int, Guild, List[int], List[Guild]]]) – The “scope”/applicable guilds the application command applies to. Defaults to None.

  • default_permission? (Optional[bool]) – The default permission of accessibility for the application command. Defaults to True.

  • name_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the name field. This enforces the same restrictions as the name field.

  • default_member_permissions? (Optional[Union[int, Permissions]]) – The permissions bit value of interactions.api.model.flags.Permissions. If not given, defaults to interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS() or 2147483648

  • dm_permission? (Optional[bool]) – The application permissions if executed in a Direct Message. Defaults to True.

  • default_scope? (bool) – Whether the scope of the command is the default scope set in the client. Defaults to True.

  • scope (Optional[Union[int, Guild, List[int], List[Guild]]]) –

  • name_localizations (Optional[Dict[Union[str, Locale], Any]]) –

  • default_member_permissions (Optional[Union[int, Permissions]]) –

  • dm_permission (Optional[bool]) –

  • default_scope (bool) –

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Command]

component(component)#

A decorator for listening to INTERACTION_CREATE dispatched gateway events involving components.

The structure for a component callback:

# Method 1
@component(interactions.Button(
    style=interactions.ButtonStyle.PRIMARY,
    label="click me!",
    custom_id="click_me_button",
))
async def button_response(ctx):
    ...

# Method 2
@component("custom_id")
async def button_response(ctx):
    ...

The context of the component callback decorator inherits the same as of the command decorator.

Parameters:

component (Union[str, Button, SelectMenu]) – The component you wish to callback for.

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Callable[…, Coroutine]]

_find_command(command)#

Iterates over commands and returns an ApplicationCommand if it matches the name from command

Parameters:

command (Union[str, int]) – The name or ID of the command to match

Returns:

An ApplicationCommand model

Return type:

ApplicationCommand

autocomplete(command, name)#

A decorator for listening to INTERACTION_CREATE dispatched gateway events involving autocompletion fields.

The structure for an autocomplete callback:

@autocomplete(command="command_name", name="option_name")
async def autocomplete_choice_list(ctx, user_input: str = ""):
    await ctx.populate([
        interactions.Choice(...),
        interactions.Choice(...),
        ...
    ])
Parameters:
Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Callable[…, Coroutine]]

modal(modal)#

A decorator for listening to INTERACTION_CREATE dispatched gateway events involving modals.

The structure for a modal callback:

@modal(interactions.Modal(
    interactions.TextInput(
        style=interactions.TextStyleType.PARAGRAPH,
        custom_id="how_was_your_day_field",
        label="How has your day been?",
        placeholder="Well, so far...",
    ),
))
async def modal_response(ctx):
    ...

The context of the modal callback decorator inherits the same as of the component decorator.

Parameters:

modal (Union[Modal, str]) – The modal or custom_id of modal you wish to callback for.

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Callable[…, Coroutine]]

load(name, package=None, *args, **kwargs)#

“Loads” an extension off of the current client by adding a new class which is imported from the library.

Parameters:
  • name (str) – The name of the extension.

  • package? (Optional[str]) – The package of the extension.

  • *args? – Optional arguments to pass to the extension

  • **kwargs? (dict) – Optional keyword-only arguments to pass to the extension.

  • package (Optional[str]) –

Returns:

The loaded extension.

Return type:

Optional[Extension]

remove(name, remove_commands=True, package=None)#

Removes an extension out of the current client from an import resolve.

Parameters:
  • name (str) – The name of the extension.

  • remove_commands? (bool) – Whether to remove commands before reloading. Defaults to True.

  • package? (Optional[str]) – The package of the extension.

  • remove_commands (bool) –

  • package (Optional[str]) –

Return type:

None

reload(name, package=None, remove_commands=True, *args, **kwargs)#

“Reloads” an extension off of current client from an import resolve.

Warning

This will remove and re-add application commands, counting towards your daily application command creation limit, as long as you have the remove_commands argument set to True, what it is by default.

Parameters:
  • name (str) – The name of the extension

  • package? (Optional[str]) – The package of the extension

  • remove_commands? (bool) – Whether to remove commands before reloading. Defaults to True

  • *args? – Optional arguments to pass to the extension

  • **kwargs? (dict) – Optional keyword-only arguments to pass to the extension.

  • package (Optional[str]) –

  • remove_commands (bool) –

Returns:

The reloaded extension.

Return type:

Optional[Extension]

async modify(username=<interactions.MISSING>, avatar=<interactions.MISSING>)#

Modify the bot user account settings.

Parameters:
  • username? (Optional[str]) – The new username of the bot

  • avatar? (Optional[Image]) – The new avatar of the bot

  • username (Optional[str]) –

  • avatar (Optional[Image]) –

Returns:

The modified User object

Return type:

User

async request_guild_members(guild_id, limit=<interactions.MISSING>, query=<interactions.MISSING>, presences=<interactions.MISSING>, user_ids=<interactions.MISSING>, nonce=<interactions.MISSING>)#

Requests guild members via websocket.

Parameters:
  • guild_id (Union[Guild, Snowflake, int, str]) – ID of the guild to get members for.

  • limit (Optional[int]) – Maximum number of members to send matching the ‘query’ parameter. Required when specifying ‘query’.

  • query (Optional[str]) – String that username starts with.

  • presences (Optional[bool]) – Used to specify if we want the presences of the matched members.

  • user_ids (Optional[Union[Snowflake, List[Snowflake]]]) – Used to specify which users you wish to fetch.

  • nonce (Optional[str]) – Nonce to identify the Guild Members Chunk response.

Return type:

None

class interactions.client.bot.Extension(client, *args, **kwargs)#

A class that allows you to represent “extensions” of your code, or essentially cogs that can be ran independent of the root file in an object-oriented structure.

The structure of an extension:

class CoolCode(interactions.Extension):
    def __init__(self, client):
        self.client = client

    @command(
        type=interactions.ApplicationCommandType.USER,
        name="User command in cog",
    )
    async def cog_user_cmd(self, ctx):
        ...

def setup(client):
    CoolCode(client)
Parameters:

client (Client) –

Return type:

Extension

interactions.client.bot.extension_command(self, *, type=ApplicationCommandType.CHAT_INPUT, name=<interactions.MISSING>, description=<interactions.MISSING>, scope=<interactions.MISSING>, options=<interactions.MISSING>, name_localizations=<interactions.MISSING>, description_localizations=<interactions.MISSING>, default_member_permissions=<interactions.MISSING>, dm_permission=<interactions.MISSING>, default_scope=True)#

A decorator for registering an application command to the Discord API, as well as being able to listen for INTERACTION_CREATE dispatched gateway events.

The structure of a chat-input command:

@command(name="command-name", description="this is a command.")
async def command_name(ctx):
    ...

You are also able to establish it as a message or user command by simply passing the type kwarg field into the decorator:

@command(type=interactions.ApplicationCommandType.MESSAGE, name="Message Command")
async def message_command(ctx):
    ...

The scope kwarg field may also be used to designate the command in question applicable to a guild or set of guilds.

To properly utilise the default_member_permissions kwarg, it requires OR’ing the permission values, similar to instantiating the client with Intents. For example:

@command(name="kick", description="Kick a user.", default_member_permissions=interactions.Permissions.BAN_MEMBERS | interactions.Permissions.KICK_MEMBERS)
async def kick(ctx, user: interactions.Member):
    ...

Another example below for instance is an admin-only command:

@command(name="sudo", description="this is an admin-only command.", default_member_permissions=interactions.Permissions.ADMINISTRATOR)
async def sudo(ctx):
    ...

Note

If default_member_permissions is not given, this will default to anyone that is able to use the command.

Parameters:
  • type? (Optional[Union[str, int, ApplicationCommandType]]) – The type of application command. Defaults to interactions.enums.ApplicationCommandType.CHAT_INPUT() or 1.

  • name (Optional[str]) – The name of the application command. This is required but kept optional to follow kwarg rules.

  • description? (Optional[str]) – The description of the application command. This should be left blank if you are not using CHAT_INPUT.

  • scope? (Optional[Union[int, Guild, List[int], List[Guild]]]) – The “scope”/applicable guilds the application command applies to.

  • options? (Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]]) – The “arguments”/options of an application command. This should be left blank if you are not using CHAT_INPUT.

  • name_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the name field. This enforces the same restrictions as the name field.

  • description_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the description field. This enforces the same restrictions as the description field.

  • default_member_permissions? (Optional[Union[int, Permissions]]) – The permissions bit value of interactions.api.model.flags.Permissions. If not given, defaults to interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS() or 2147483648

  • dm_permission? (Optional[bool]) – The application permissions if executed in a Direct Message. Defaults to True.

  • default_scope? (bool) – Whether the scope of the command is the default scope set in the client. Defaults to True.

  • type (Optional[Union[int, ApplicationCommandType]]) –

  • description (Optional[str]) –

  • scope (Optional[Union[int, Guild, List[int], List[Guild]]]) –

  • options (Optional[Union[Dict[str, Any], List[Dict[str, Any]], Option, List[Option]]]) –

  • name_localizations (Optional[Dict[Union[str, Locale], str]]) –

  • description_localizations (Optional[Dict[Union[str, Locale], str]]) –

  • default_member_permissions (Optional[Union[int, Permissions]]) –

  • dm_permission (Optional[bool]) –

  • default_scope (bool) –

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Command]

interactions.client.bot.extension_component(self, component)#

A decorator for listening to INTERACTION_CREATE dispatched gateway events involving components.

The structure for a component callback:

# Method 1
@component(interactions.Button(
    style=interactions.ButtonStyle.PRIMARY,
    label="click me!",
    custom_id="click_me_button",
))
async def button_response(ctx):
    ...

# Method 2
@component("custom_id")
async def button_response(ctx):
    ...

The context of the component callback decorator inherits the same as of the command decorator.

Parameters:

component (Union[str, Button, SelectMenu]) – The component you wish to callback for.

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Callable[…, Coroutine]]

interactions.client.bot.extension_modal(self, modal)#

A decorator for listening to INTERACTION_CREATE dispatched gateway events involving modals.

The structure for a modal callback:

@modal(interactions.Modal(
    interactions.TextInput(
        style=interactions.TextStyleType.PARAGRAPH,
        custom_id="how_was_your_day_field",
        label="How has your day been?",
        placeholder="Well, so far...",
    ),
))
async def modal_response(ctx):
    ...

The context of the modal callback decorator inherits the same as of the component decorator.

Parameters:

modal (Union[Modal, str]) – The modal or custom_id of modal you wish to callback for.

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Callable[…, Coroutine]]

interactions.client.bot.extension_autocomplete(self, command, name)#

A decorator for listening to INTERACTION_CREATE dispatched gateway events involving autocompletion fields.

The structure for an autocomplete callback:

@autocomplete(command="command_name", name="option_name")
async def autocomplete_choice_list(ctx, user_input: str = ""):
    await ctx.populate([
        interactions.Choice(...),
        interactions.Choice(...),
        ...
    ])
Parameters:
Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Callable[…, Coroutine]]

interactions.client.bot.extension_user_command(self, *, name=<interactions.MISSING>, scope=<interactions.MISSING>, name_localizations=<interactions.MISSING>, default_member_permissions=<interactions.MISSING>, dm_permission=<interactions.MISSING>, default_scope=True)#

A decorator for registering a user context menu to the Discord API, as well as being able to listen for INTERACTION_CREATE dispatched gateway events.

The structure of a user context menu:

@user_command(name="Context menu name")
async def context_menu_name(ctx):
    ...

The scope kwarg field may also be used to designate the command in question applicable to a guild or set of guilds.

Parameters:
  • name (Optional[str]) – The name of the application command.

  • scope? (Optional[Union[int, Guild, List[int], List[Guild]]]) – The “scope”/applicable guilds the application command applies to. Defaults to None.

  • default_permission? (Optional[bool]) – The default permission of accessibility for the application command. Defaults to True.

  • name_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the name field. This enforces the same restrictions as the name field.

  • default_member_permissions? (Optional[Union[int, Permissions]]) – The permissions bit value of interactions.api.model.flags.Permissions. If not given, defaults to interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS() or 2147483648

  • dm_permission? (Optional[bool]) – The application permissions if executed in a Direct Message. Defaults to True.

  • default_scope? (bool) – Whether the scope of the command is the default scope set in the client. Defaults to True.

  • scope (Optional[Union[int, Guild, List[int], List[Guild]]]) –

  • name_localizations (Optional[Dict[Union[str, Locale], Any]]) –

  • default_member_permissions (Optional[Union[int, Permissions]]) –

  • dm_permission (Optional[bool]) –

  • default_scope (bool) –

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Command]

interactions.client.bot.extension_message_command(self, *, name=<interactions.MISSING>, scope=<interactions.MISSING>, name_localizations=<interactions.MISSING>, default_member_permissions=<interactions.MISSING>, dm_permission=<interactions.MISSING>, default_scope=True)#

A decorator for registering a message context menu to the Discord API, as well as being able to listen for INTERACTION_CREATE dispatched gateway events.

The structure of a message context menu:

@message_command(name="Context menu name")
async def context_menu_name(ctx):
    ...

The scope kwarg field may also be used to designate the command in question applicable to a guild or set of guilds.

Parameters:
  • name (Optional[str]) – The name of the application command.

  • scope? (Optional[Union[int, Guild, List[int], List[Guild]]]) – The “scope”/applicable guilds the application command applies to. Defaults to None.

  • default_permission? (Optional[bool]) – The default permission of accessibility for the application command. Defaults to True.

  • name_localizations? (Optional[Dict[Union[str, Locale], str]]) – The dictionary of localization for the name field. This enforces the same restrictions as the name field.

  • default_member_permissions? (Optional[Union[int, Permissions]]) – The permissions bit value of interactions.api.model.flags.Permissions. If not given, defaults to interactions.api.model.flags.Permissions.USE_APPLICATION_COMMANDS() or 2147483648

  • dm_permission? (Optional[bool]) – The application permissions if executed in a Direct Message. Defaults to True.

  • default_scope? (bool) – Whether the scope of the command is the default scope set in the client. Defaults to True.

  • scope (Optional[Union[int, Guild, List[int], List[Guild]]]) –

  • name_localizations (Optional[Dict[Union[str, Locale], Any]]) –

  • default_member_permissions (Optional[Union[int, Permissions]]) –

  • dm_permission (Optional[bool]) –

  • default_scope (bool) –

Returns:

A callable response.

Return type:

Callable[[Callable[…, Coroutine]], Command]