### Configure App Installation Parameters in discord.py Source: https://discordpy.readthedocs.io/ja/stable/genindex Shows how to set application installation parameters, specifically focusing on the `scopes` attribute, which defines the permissions your application requests when installed. ```python discord.AppInstallParams.scopes ``` -------------------------------- ### Discord Server Guide Creation Source: https://discordpy.readthedocs.io/ja/stable/api Represents the creation of a guild's server guide. ```python home_settings_create ``` -------------------------------- ### IntegrationTypeConfig Oauth2 Install Params Source: https://discordpy.readthedocs.io/ja/stable/api Represents the default settings for an application's installation context, specifically its OAuth2 install parameters. ```python integration_config = discord.IntegrationTypeConfig(oauth2_install_params=discord.AppInstallParams(...)) ``` -------------------------------- ### Setup Hooks and Logging in discord.py Source: https://discordpy.readthedocs.io/ja/stable/genindex Covers the `setup_hook` method for both `discord.Client` and `commands.Bot`, which is used for asynchronous setup tasks. Also includes `discord.utils.setup_logging()` for configuring logging. ```python discord.Client.setup_hook() commands.Bot.setup_hook() discord.utils.setup_logging() ``` -------------------------------- ### Discord Application Install Parameters Source: https://discordpy.readthedocs.io/ja/stable/genindex Refers to 'install_params' within Discord's AppInfo, which likely contains information about the parameters required for installing an application. ```python discord.AppInfo.install_params ``` -------------------------------- ### Edit Application User Install Permissions Source: https://discordpy.readthedocs.io/ja/stable/api Allows setting or removing the permissions for the default user installation context. Requires a Permissions object. ```python async def edit( *, user_install_permissions: Optional[Permissions] = None, ... ): ... ``` -------------------------------- ### Indicate User Installable Command Source: https://discordpy.readthedocs.io/ja/stable/interactions/api Use the `@app_commands.user_install` decorator to mark a command as installable by users. Discord handles this server-side, and the decorator is ignored for subcommands. ```python @app_commands.command() @app_commands.user_install() async def my_user_install_command(interaction: discord.Interaction) -> None: await interaction.response.send_message('I am installed in users by default!') ``` -------------------------------- ### Discord Help Command Get Source: https://discordpy.readthedocs.io/ja/stable/genindex No description -------------------------------- ### Manage Custom Install URL in Discord.py Source: https://discordpy.readthedocs.io/ja/stable/genindex Provides access to the custom install URL for an application, which might be used for specific integration or distribution scenarios. ```python discord.AppInfo.custom_install_url ``` -------------------------------- ### Generate OAuth2 Install URL with discord.utils.oauth_url Source: https://discordpy.readthedocs.io/ja/stable/genindex This function generates a URL for installing an OAuth2 application. It requires a client ID and can optionally include scopes and permissions for the authorization process. ```python discord.utils.oauth_url(client_id, *, scopes=(), permissions=Permissions.empty(), redirect_uri=None, **kwargs) ``` -------------------------------- ### Get Discord View Timeout Source: https://discordpy.readthedocs.io/ja/stable/interactions/api The timeout in seconds until input is no longer accepted, starting from the last UI interaction. If None, there is no timeout. ```python _property_ timeout """The timeout in seconds until input is no longer accepted, starting from the last UI interaction. If None, there is no timeout. Type ---- Optional[float] """ pass ``` -------------------------------- ### Handle Discord Onboarding Features Source: https://discordpy.readthedocs.io/ja/stable/genindex This covers various aspects of Discord's onboarding feature, including configuration, prompts, options, and modes. It also lists audit log actions related to onboarding. ```python discord.IntegrationTypeConfig.oauth2_install_params discord.Onboarding discord.Guild.onboarding() discord.AuditLogAction.onboarding_create discord.AuditLogAction.onboarding_prompt_create discord.AuditLogAction.onboarding_prompt_delete discord.AuditLogAction.onboarding_prompt_update discord.AuditLogAction.onboarding_update discord.OnboardingMode discord.OnboardingPrompt discord.OnboardingPromptOption discord.OnboardingPromptType ``` -------------------------------- ### AppCommandChannel Position Attribute Source: https://discordpy.readthedocs.io/ja/stable/interactions/api Gets the position of the AppCommandChannel in the channel list, starting from 0 for the top channel. Added in version 2.6. ```Python position ``` -------------------------------- ### Iterating and Checking PublicUserFlags Source: https://discordpy.readthedocs.io/ja/stable/api Provides examples of iterating through PublicUserFlags to get flag names and values, and checking if any flag is set using boolean conversion. ```python iter(user_flags) bool(user_flags) ``` -------------------------------- ### Run Discord Bot Client Source: https://discordpy.readthedocs.io/ja/stable/genindex Provides the essential methods for running a Discord bot client using discord.py. This includes starting the bot and handling its lifecycle. ```python discord.Client.run(token) commands.Bot.run(token) ``` -------------------------------- ### Initialize discord.Client with options Source: https://discordpy.readthedocs.io/ja/stable/api Demonstrates initializing the discord.Client with various optional parameters to configure its behavior, such as message caching, proxy settings, sharding, intents, and activity status. The client can be used asynchronously with 'async with'. ```python client = discord.Client( max_messages=1000, proxy="http://user:pass@host:port", proxy_auth=aiohttp.BasicAuth("user", "pass"), shard_id=0, shard_count=1, intents=discord.Intents.default(), member_cache_flags=discord.MemberCacheFlags(online=False), chunk_guilds_at_startup=False, status=discord.Status.online, activity=discord.Game(name="Hello World"), allowed_mentions=discord.AllowedMentions(everyone=False), heartbeat_timeout=60.0, guild_ready_timeout=2.0, assume_unsync_clock=True, enable_debug_events=False, enable_raw_presences=False, http_trace=aiohttp.TraceConfig(), max_ratelimit_timeout=30.0, connector=aiohttp.TCPConnector() ) async with client: await client.start("YOUR_BOT_TOKEN") ``` -------------------------------- ### Get Discord View Children Source: https://discordpy.readthedocs.io/ja/stable/interactions/api Gets a list of children attached to this view. ```python _property_ children """A list of children attached to this view. Type ---- List[Item] """ pass ``` -------------------------------- ### Onboarding Modes Source: https://discordpy.readthedocs.io/ja/stable/genindex Different modes for Discord's onboarding feature. ```APIDOC ## Onboarding Modes ### Description Details on the various modes available for Discord's server onboarding feature. ### Enums - **discord.OnboardingMode.advanced**: Represents the advanced onboarding mode. ### Examples ```python # Conceptual example of setting onboarding mode # await guild.edit(onboarding_mode=discord.OnboardingMode.advanced) ``` ``` -------------------------------- ### Fetch Session Start Limits Source: https://discordpy.readthedocs.io/ja/stable/api Retrieves the session start limits for the application. This is an asynchronous function typically used with IPC for optimizing session starts in large-scale sharding scenarios. It can raise GatewayNotFound if the gateway is unreachable. ```python await _fetch_session_start_limits() ``` -------------------------------- ### discord.py: Entitlement Start Time Source: https://discordpy.readthedocs.io/ja/stable/genindex Accesses the start time for entitlements in discord.py. ```python discord.Entitlement.starts_at ``` -------------------------------- ### Fetch Onboarding Configuration Source: https://discordpy.readthedocs.io/ja/stable/api Fetches the onboarding configuration for a guild. This is an asynchronous operation. ```python onboarding_config = await guild.onboarding() print(onboarding_config) ``` -------------------------------- ### Discord Server Guide Update Source: https://discordpy.readthedocs.io/ja/stable/api Represents the update of a guild's server guide. ```python home_settings_update ``` -------------------------------- ### Client and Bot Ready Checks Source: https://discordpy.readthedocs.io/ja/stable/genindex Checks if the client or bot is ready. ```APIDOC ## discord.Client.is_ready ### Description Checks if the client is ready to start processing events. ### Method GET ### Endpoint N/A (Attribute of a Client object) ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool**: True if the client is ready, False otherwise. #### Response Example ```json { "is_ready": true } ``` ## commands.Bot.is_ready ### Description Checks if the bot is ready to start processing commands. ### Method GET ### Endpoint N/A (Attribute of a Bot object) ### Parameters None ### Request Example None ### Response #### Success Response (200) - **bool**: True if the bot is ready, False otherwise. #### Response Example ```json { "is_ready": true } ``` ``` -------------------------------- ### Discord Session Start Limits Source: https://discordpy.readthedocs.io/ja/stable/genindex Details session start limits, including the total number of allowed sessions. ```python discord.SessionStartLimits.total ``` -------------------------------- ### AppInstallationType in discord.py Source: https://discordpy.readthedocs.io/ja/stable/interactions/api Defines the installation location for an application command, specifying if it's installed in a guild or for a user. Added in version 2.4. ```python class discord.app_commands.AppInstallationType(_*_ , _guild =None_, _user =None_) Attributes * guild * user Represents the installation location of an application command. バージョン 2.4 で追加. パラメータ * **guild** (Optional[`bool`]) -- Whether the integration is a guild install. * **user** (Optional[`bool`]) -- Whether the integration is a user install. _property_ guild¶ Whether the integration is a guild install. 型 `bool` _property_ user¶ Whether the integration is a user install. 型 `bool` ``` -------------------------------- ### Command and Argument Handling Source: https://discordpy.readthedocs.io/ja/stable/genindex Documentation for command definitions, argument parsing, and cooldown management. ```APIDOC ## commands.Command.require_var_positional ### Description Indicates if a command requires a variable positional argument. ### Method N/A (Attribute) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (N/A) - **require_var_positional** (bool) - True if the command requires a variable positional argument, False otherwise. #### Response Example None ``` ```APIDOC ## discord.app_commands.Argument.required ### Description Indicates if an application command argument is required. ### Method N/A (Attribute) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (N/A) - **required** (bool) - True if the argument is required, False otherwise. #### Response Example None ``` ```APIDOC ## commands.Parameter.required ### Description Indicates if a command parameter is required. ### Method N/A (Attribute) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (N/A) - **required** (bool) - True if the parameter is required, False otherwise. #### Response Example None ``` ```APIDOC ## commands.Command.reset_cooldown() ### Description Resets the cooldown for a command. ### Method POST ### Endpoint N/A (Internal method) ### Parameters None ### Request Example None ### Response #### Success Response (204) No content is returned on successful reset. #### Response Example None ``` ```APIDOC ## discord.app_commands.CommandOnCooldown.retry_after ### Description Indicates the time in seconds until the command can be used again. ### Method N/A (Attribute) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (N/A) - **retry_after** (float) - The number of seconds to wait before retrying. #### Response Example None ``` -------------------------------- ### Start a Scheduled Event Source: https://discordpy.readthedocs.io/ja/stable/api Starts a scheduled event. This is a coroutine and requires the `manage_events` permission. It can raise ValueError, Forbidden, or HTTPException. ```python await event.start(reason="Optional reason for starting") ``` -------------------------------- ### Discord.py: Permissions and Audio Handling Source: https://discordpy.readthedocs.io/ja/stable/genindex This section details creating permission overwrites from pairs and initializing FFmpeg Opus audio from a probe. ```python import discord # Example: Creating PermissionOverwrite from a pair # overwrite = discord.PermissionOverwrite.from_pair(discord.Permissions.send_messages, True) # Example: Initializing FFmpegOpusAudio from probe # audio = discord.FFmpegOpusAudio.from_probe('path/to/audio.mp3') ``` -------------------------------- ### Handle Role Permissions and Select Options in Discord.py Source: https://discordpy.readthedocs.io/ja/stable/genindex Covers attributes related to member roles, role permissions, and role selection options in onboarding prompts. ```python discord.Member.roles discord.OnboardingPromptOption.roles ``` -------------------------------- ### Edit Application User Install Scopes Source: https://discordpy.readthedocs.io/ja/stable/api Allows setting or removing the list of OAuth2 scopes for the default user installation context. ```python async def edit( *, user_install_scopes: Optional[List[str]] = None, ... ): ... ``` -------------------------------- ### Get Onboarding Prompt in Discord.py Source: https://discordpy.readthedocs.io/ja/stable/genindex Retrieves an onboarding prompt from the onboarding configuration. This is a method of `discord.Onboarding`. ```python onboarding.get_prompt(prompt_id) ``` -------------------------------- ### Edit Application Guild Install Scopes Source: https://discordpy.readthedocs.io/ja/stable/api Allows setting or removing the list of OAuth2 scopes for the default guild installation context. ```python async def edit( *, guild_install_scopes: Optional[List[str]] = None, ... ): ... ``` -------------------------------- ### Initialize FFmpegPCMAudio Source: https://discordpy.readthedocs.io/ja/stable/api Initializes an FFmpegPCMAudio object to process audio using FFmpeg or AVConv. Requires the FFmpeg or AVConv executable to be in the environment's PATH. ```python discord.FFmpegPCMAudio(source, *, executable='ffmpeg', pipe=False, stderr=None, before_options=None, options=None) ``` -------------------------------- ### discord.py: Activity Start Time Source: https://discordpy.readthedocs.io/ja/stable/api Retrieves the UTC time when the user started the activity, if available. This is a property of the Activity class in discord.py. ```python Activity.start ``` -------------------------------- ### Discord Default Intents and Help Command Configuration Source: https://discordpy.readthedocs.io/ja/stable/genindex Shows how to use default intents for the Discord client and configure default settings for help commands. ```python discord.Intents.default() commands.DefaultHelpCommand.default_argument_description ``` -------------------------------- ### Edit Application Guild Install Permissions Source: https://discordpy.readthedocs.io/ja/stable/api Allows setting or removing the permissions for the default guild installation context. Requires a Permissions object. ```python async def edit( *, guild_install_permissions: Optional[Permissions] = None, ... ): ... ``` -------------------------------- ### Create Onboarding Prompt Option Source: https://discordpy.readthedocs.io/ja/stable/api Represents an option for a Discord onboarding prompt. This class can be manually created for Guild.edit_onboarding(). It includes attributes for title, emoji, description, and associated channels and roles. ```python class OnboardingPromptOption: def __init__(self, *, title: str, emoji: Union[Emoji, PartialEmoji, str], description: Optional[str] = None, channels: Iterable[Union[abc.Snowflake, int]] = None, roles: Iterable[Union[abc.Snowflake, int]] = None): self.title = title self.emoji = emoji self.description = description self.channels = channels self.roles = roles @property def id(self) -> int: # Returns the ID of this prompt option. If manually created, the ID will be 0. pass @property def guild(self) -> Guild: # Returns the guild this prompt option is related to. # Raises ValueError if the prompt option was created manually. pass @property def channels(self) -> List[Union[abc.GuildChannel, Thread]]: # Returns the list of channels which will be made visible if this option is selected. # Raises ValueError if the prompt option is manually created, therefore has no guild. pass @property def roles(self) -> List[Role]: # Returns the list of roles given to the user if this option is selected. # Raises ValueError if the prompt option is manually created, therefore has no guild. pass ``` -------------------------------- ### Fetch Welcome Screen Source: https://discordpy.readthedocs.io/ja/stable/api Retrieves the guild's welcome screen. Requires the guild to have the `COMMUNITY` feature enabled and the `manage_guild` permission. ```python await guild.welcome_screen() ``` -------------------------------- ### Help Command Formatting Source: https://discordpy.readthedocs.io/ja/stable/genindex Customization options for the default help command. ```APIDOC ## Help Command Formatting ### Description Allows customization of the output format for the default help command in discord.py. ### Methods - **commands.DefaultHelpCommand.add_command_arguments()**: Formats command arguments for the help output. - **commands.DefaultHelpCommand.add_command_formatting()**: Formats individual commands for the help output. - **commands.MinimalHelpCommand.add_aliases_formatting()**: Formats aliases for the help output. - **commands.MinimalHelpCommand.add_bot_commands_formatting()**: Formats bot commands for the help output. - **commands.MinimalHelpCommand.add_command_formatting()**: Formats individual commands for the help output. - **commands.MinimalHelpCommand.add_subcommand_formatting()**: Formats subcommands for the help output. ### Attributes - **commands.MinimalHelpCommand.aliases_heading**: The heading used for aliases in the help command. ### Examples ```python # Conceptual example of customizing help command formatting # class CustomHelpCommand(commands.DefaultHelpCommand): # async def format_command_signature(self, command): # return f'{self.context.clean_prefix}{command.signature}' # bot.help_command = CustomHelpCommand() ``` ``` -------------------------------- ### Create and Configure a Discord Embed Source: https://discordpy.readthedocs.io/ja/stable/api Demonstrates how to create a discord.Embed object and set its various properties like title, description, author, footer, image, and thumbnail. It also shows how to add fields to the embed. ```python import discord embed = discord.Embed( title="My Embed Title", description="This is the description of my embed.", color=discord.Color.blue() ) embed.set_author(name="Author Name", url="https://example.com", icon_url="https://example.com/icon.png") embed.set_thumbnail(url="https://example.com/thumbnail.png") embed.add_field(name="Field 1", value="Value 1", inline=True) embed.add_field(name="Field 2", value="Value 2", inline=False) embed.set_footer(text="This is the footer", icon_url="https://example.com/footer_icon.png") # To send this embed, you would typically use a discord.Client or discord.ext.commands.Bot instance: # await ctx.send(embed=embed) ``` -------------------------------- ### File and Reaction Handling Source: https://discordpy.readthedocs.io/ja/stable/genindex Information on adding files to messages and reactions to messages. ```APIDOC ## File and Reaction Handling ### Description Covers methods for attaching files to messages and adding reactions to messages. ### Methods - **InteractionMessage.add_files()**: Adds files to an interaction message. - **Message.add_files()**: Adds files to a message. - **SyncWebhookMessage.add_files()**: Adds files to a synchronized webhook message. - **WebhookMessage.add_files()**: Adds files to a webhook message. - **InteractionMessage.add_reaction()**: Adds a reaction to an interaction message. - **Message.add_reaction()**: Adds a reaction to a message. - **PartialMessage.add_reaction()**: Adds a reaction to a partial message. - **WebhookMessage.add_reaction()**: Adds a reaction to a webhook message. ### Examples ```python # Sending a message with a file with open('my_file.txt', 'rb') as f: await channel.send(file=discord.File(f)) # Adding a reaction to a message await message.add_reaction('👍') ``` ``` -------------------------------- ### Edit Discord Application Info with discord.py Source: https://discordpy.readthedocs.io/ja/stable/api Demonstrates how to edit various attributes of a Discord application using the `asyncedit` method of the `AppInfo` class. This includes updating the custom install URL, description, role connections verification URL, install parameters, flags, icon, cover image, interactions endpoint URL, tags, and guild/user install scopes and permissions. ```Python await app_info.asyncedit( custom_install_url="https://example.com/custom_install", description="Updated bot description.", role_connections_verification_url="https://example.com/verify", install_params_scopes=["identify", "guilds"], install_params_permissions=discord.Permissions(read_messages=True), flags=discord.ApplicationFlags.gateway_presence_limited, icon=await discord.File("path/to/new_icon.png"), cover_image=await discord.File("path/to/new_cover.png"), interactions_endpoint_url="https://example.com/interactions", tags=["fun", "utility"], guild_install_scopes=["applications.commands"], guild_install_permissions=discord.Permissions(manage_guild=True), user_install_scopes=["applications.commands.permissions.update"], user_install_permissions=discord.Permissions(change_nickname=True) ) ``` -------------------------------- ### Discord Onboarding Source: https://discordpy.readthedocs.io/ja/stable/genindex Details related to Discord's onboarding feature, including its modes, prompts, and related audit log actions. ```APIDOC ## Discord Onboarding ### Description Documentation for Discord's onboarding feature, covering onboarding configurations, prompts, and associated audit log actions. ### Method Configuration / Audit log actions ### Endpoint N/A (Feature configuration) ### Parameters - `discord.Onboarding`: Represents the onboarding configuration for a guild. - `discord.Guild.onboarding()`: Method to access the guild's onboarding configuration. - `discord.OnboardingMode`: Enum for different onboarding modes. - `discord.OnboardingPrompt`: Represents an onboarding prompt. - `discord.OnboardingPromptOption`: Represents an option for an onboarding prompt. - `discord.OnboardingPromptType`: Enum for different types of onboarding prompts. - `discord.AuditLogAction.onboarding_create`: Audit log action for creating an onboarding configuration. - `discord.AuditLogAction.onboarding_prompt_create`: Audit log action for creating an onboarding prompt. - `discord.AuditLogAction.onboarding_prompt_delete`: Audit log action for deleting an onboarding prompt. - `discord.AuditLogAction.onboarding_prompt_update`: Audit log action for updating an onboarding prompt. - `discord.AuditLogAction.onboarding_update`: Audit log action for updating an onboarding configuration. ``` -------------------------------- ### Get Team Member Handle in discord.py Source: https://discordpy.readthedocs.io/ja/stable/api Shows how to get a string representation of a TeamMember, often their username or username#discriminator, using the str() function. This is useful for displaying member information. ```python str(x) ``` -------------------------------- ### Discord Guild Onboarding Creation Source: https://discordpy.readthedocs.io/ja/stable/api Represents the creation of a guild's onboarding configuration. The target is always None. Use 'guild' to access the guild. AuditLogDiff provides attributes like enabled, default_channels, prompts, and mode. ```python onboarding_create ``` -------------------------------- ### AppCommandChannel Name Attribute Source: https://discordpy.readthedocs.io/ja/stable/interactions/api Gets the name of the AppCommandChannel. ```Python name ```