Component Libraries •
Project Templates
Docs •
Install •
Tutorials •
Developer Guides •
Contribute •
Blog •
Discord
Xircuits Component Library to interface with Discord! Create Discord Bots in seconds.
Uses discord.py as backend.
To use this component library, ensure that you have an existing Xircuits setup. You can then pull and install this library using:
xircuits-submodules xai_discord
Otherwise you can do it manually by cloning and installing it.
# base Xircuits directory
git clone https://github.com/XpressAI/xai-discord xai_components/xai_discord
pip install -r xai_components/xai_discord/requirements.txt
- Log in to the Discord Developer Portal.
- Click on the "New Application" button in the top-right corner.
- Enter a name for your application and click "Create".
- In the application's settings, navigate to the "Bot" tab.
- You will need to enable some
Privileged Gateway Intents
to enable bot interation. For this component library,MESSAGE CONTENT INTENT
should be enough. - Under the "Token" section, click "Copy" to copy the bot token to your clipboard. You may need to Reset the token if it is a new bot.
-
In the Discord Developer Portal, navigate to your application's settings.
-
Click on the "OAuth2" tab.
-
Update the "Scopes" section and then the "Bot Permissions" section. Below is the config we have used:
- bot: For OAuth2 bots, this puts the bot in the user's selected guild by default.
- applications.commands: Allows your app to use commands in a guild.
- Read Messages / View Channels: Allows the bot to read and view the channels in the server.
- Send Messages: Allows the bot to send messages in text channels.
- Read Message History: Allows the bot to read the message history of text channels.
-
Copy the generated URL from the "Scopes" section and paste it into your browser.
-
Follow the prompts to authorize your bot and add it to your desired server.
Play with our Discord bot, Xaibo here. The devs at there too.