Skip to main content

Initialize a Discord connection

info

Create a Discord App

  1. Click here: create a new Discord application

  2. Provide a name for your application, then click "Create".

    Screenshot 1: Create an application
  3. In the sidebar, navigate to the "OAuth2" menu.

    Screenshot 2: Generate an invite link
  4. Under the section titled "OAuth2 URL Generator," find the "Scopes" area and check the box labeled "bot."

    Screenshot 3: Select scope for application
  5. Under the "Bot Permissions" section, check the boxes for "View Channels" and "Send Messages."

    Screenshot 4: Select bot permissions
ATTENTION

Currently, only bot tokens are supported for authentication. Scopes that require an OAuth redirect URL will not function.

  1. For "Integration Type," select "Guild Install" (note: "User Install" requires OAuth). Next, click "Copy" to copy the install link.

    Screenshot 5: Copy install link
  2. Paste the link copied from the previous step into your browser. Select the server where you want to add the bot, then click "Continue."

    Screenshot 6: Select server to install bot
  3. Authorize the selected scopes by clicking "Authorize".

    Screenshot 7: Authorize scopes
  4. A success message will appear, confirming that the AutoKitteh bot has been installed on your server.

    Screenshot 8: Success message

Bot Token

  1. In the sidebar, navigate to the "Bot" menu.

    Screenshot 9: Navigate to bot menu
  2. Generate a new token by clicking "Reset Token".

    Screenshot 10: Generate a new token
  3. Copy the token by clicking "Copy." Save it somewhere secure, as it will not be shown again.

    Screenshot 11: Copy token
  4. After deploying your project, initialize the connection using the bot token generated in step 3.

  5. While it's not strictly necessary to enable message intents to receive events, it's recommended to do so, as it allows you to view message content.

    Screenshot 12: Toggle message intent
OPTIONAL

If the supported AutoKitteh events meet your needs, you're all set. However, client-side code may require additional permissions. For instance, in the client library quickstart, you'll find the following line of code:

intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)

If you attempt to run the client with these settings without enabling message content intents in the Discord developer portal (as mentioned in the previous step), you will encounter the following error:

"discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, consider disabling the privileged intents instead."

This also applies to other intents and permissions.