Skip to content

XpressAI/xai-discord

Repository files navigation

Component LibrariesProject Templates
DocsInstallTutorialsDeveloper GuidesContributeBlogDiscord

Xircuits Component Library to interface with Discord! Create Discord Bots in seconds.
Uses discord.py as backend.

Preview

helloXircuitsDiscord

Computer Vision Example

DiscordCVBot

Installation

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

Discord Related Setup

Obtaining the Bot Token

  1. Log in to the Discord Developer Portal.
  2. Click on the "New Application" button in the top-right corner.
  3. Enter a name for your application and click "Create".
  4. In the application's settings, navigate to the "Bot" tab.
  5. You will need to enable some Privileged Gateway Intents to enable bot interation. For this component library, MESSAGE CONTENT INTENT should be enough.
  6. 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.

Inviting the Bot to a Server

  1. In the Discord Developer Portal, navigate to your application's settings.

  2. Click on the "OAuth2" tab.

  3. Update the "Scopes" section and then the "Bot Permissions" section. Below is the config we have used:

    Scopes:

    • 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.

    Bot Permissions:

    • 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.
  4. Copy the generated URL from the "Scopes" section and paste it into your browser.

  5. Follow the prompts to authorize your bot and add it to your desired server.

Developers Discord

Play with our Discord bot, Xaibo here. The devs at there too.

About

Xircuits component library for Discord

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages