-
Notifications
You must be signed in to change notification settings - Fork 0
How to get the bot working
Iván Pérez edited this page Apr 30, 2025
·
5 revisions
There are multiple ways to deploy Ui-Py. This guide covers the recommended methods in order of preference:
- Using GitHub Container Registry (ghcr.io) - The easiest method
- Using Docker Compose - Simple local deployment
- Using Pipenv - For development or non-containerized environments
Before starting with any method, you need to:
-
Create a Discord Bot Application:
- Go to the Discord Developer Portal
- Click "New Application" and follow the prompts
- Navigate to the "Bot" tab and click "Add Bot"
- Under the "Privileged Gateway Intents" section, enable "Message Content Intent"
- Copy your bot token (you'll need this later)
-
Invite the bot to your server:
- In the Developer Portal, go to OAuth2 > URL Generator
- Select "bot" and "applications.commands" scopes
- Select the permissions your bot needs (recommended: "Send Messages", "Use Slash Commands", "Manage Messages")
- Copy the generated URL, paste it in your browser, and add the bot to your server
The simplest way to get the bot running is to use the pre-built Docker image from GitHub Container Registry:
# Pull the image
docker pull ghcr.io/taichikuji/ui-py:latest
# Run the container with your bot token
docker run -e TOKEN="YOUR_BOT_TOKEN" ghcr.io/taichikuji/ui-py:latestFor local deployment with Docker Compose:
-
Clone the repository:
git clone https://github.com/taichikuji/Ui-Py.git cd Ui-Py -
Set your bot token as an environment variable:
export TOKEN='YOUR_BOT_TOKEN_HERE'
-
Deploy with the script:
./deploy-dc.sh
This script will:
- Stop any previous instances of the bot
- Pull the latest code from the repository
- Build the Docker image
- Start the bot container
For development or non-containerized environments:
-
Clone the repository:
git clone https://github.com/taichikuji/Ui-Py.git cd Ui-Py -
Ensure you have the correct Python version installed (see Pipfile):
# Currently requires Python 3.12 pyenv install 3.12 pyenv local 3.12
-
Install dependencies:
pip install pipenv pipenv sync
-
Run the bot:
export TOKEN='YOUR_BOT_TOKEN_HERE' pipenv run python main.py
- Bot not responding? Check if you enabled the "Message Content Intent" in the Discord Developer Portal.
-
Import errors? Make sure you've installed all dependencies with
pipenv sync. -
Permission errors with Docker? Try running the commands with
sudo. - Connection issues? Check your internet connection and verify that your bot token is correct.
Need more help? Create an issue on GitHub.