Skip to content

Commit

Permalink
add setup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
itsknk committed Sep 30, 2024
1 parent 4f08846 commit f564e9e
Showing 1 changed file with 94 additions and 16 deletions.
110 changes: 94 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Automatic cracked unc event organization in your local metropolitian area?
### Features



## Project Structure

```
Expand Down Expand Up @@ -62,40 +61,119 @@ unccord-bot-go/

## Getting Started

### Prerequisites
### Setting Up Your Discord Bot

- [Go 1.20+](https://golang.org/dl/)
- TODO: Describe the process for obtaining and setting bot token locally
1. Go to the [Discord Developer Portal](https://discord.com/developers/applications).
2. Click "New Application" and name your bot.
3. Navigate to the "Bot" tab and click "Add Bot".
4. Under "Token", click "Copy" to copy your bot token. Keep this secure!
5. Enable these "Privileged Gateway Intents":
- Presence Intent
- Server Members Intent
- Message Content Intent
6. Save your changes.

### Environment Variables
### Bot Permissions

Set the required environment variables:
Ensure your bot has these permissions:
- Read Messages/View Channels
- Send Messages
- Embed Links
- Attach Files
- Read Message History
- Add Reactions
- Connect (to voice channels)
- Speak (in voice channels)

```bash
export DISCORD_BOT_TOKEN="your_discord_bot_token"
```
### Inviting the Bot to Your Server

### Installation
1. In the Developer Portal, go to "OAuth2" > "URL Generator".
2. Select scopes: "bot" and "applications.commands".
3. Choose the permissions listed above.
4. Copy the generated URL and open it to invite the bot to your server.

1. Clone the repository:
## Project Setup

### Prerequisites

- [Go 1.20+](https://golang.org/dl/)
- Docker and Docker Compose
- Your Discord bot token

### Configuration

1. Clone the repository:
```bash
git clone https://github.com/yourusername/unccord-bot-go.git
https://github.com/cracked-unc-club/unccord-bot-go.git
cd unccord-bot-go
```

2. Install dependencies:
2. Update the `.env` file in the project root:
```
#DB config
DB_HOST=db
DB_PORT=5432
DB_USER=potclean
DB_PASSWORD=yourpass # Change this to a secure password
DB_NAME=potclean
#Starboard config
STARBOARD_CHANNEL_ID=1282793245289484420 # Update with your channel ID
STAR_THRESHOLD=1
#JoinToCreate config
JOIN_TO_CREATE_CHANNEL_ID=1286835730705813574 # Update with your channel ID
#Discord config
DISCORD_TOKEN=yourtoken # Replace with your actual bot token
# Lavalink Configuration
*JAVA*OPTIONS=-Xmx6G
SERVER_PORT=2333
SERVER_ADDRESS=lavalink
LAVALINK_SERVER_PASSWORD=yourpass # Change this to a secure password
```
Replace `yourpass`, `yourtoken`, and the channel IDs with your actual values.

### Building and Running with Docker

1. Ensure Docker and Docker Compose are installed on your system.

2. Build the Docker images:
```bash
go mod download
docker-compose build
```

3. Run the bot:
3. Start the services:
```bash
docker-compose up -d
```

4. Check the logs to ensure everything is running correctly:
```bash
go run cmd/main.go
docker-compose logs -f
```

5. The first time you run the bot, you'll need to authorize the YouTube integration:
- Look for a log message from the Lavalink container with a URL and code.
- Go to the provided URL (usually https://www.google.com/device) and enter the code.
- Use a burner Google account for this, not your main account.

### Troubleshooting

- If the bot doesn't connect, check your `DISCORD_TOKEN` in the `.env` file.
- For database issues, ensure the `DB_PASSWORD` is correct and the PostgreSQL container is running.
- If Lavalink fails to connect, verify the `LAVALINK_SERVER_PASSWORD` matches in both the bot and Lavalink configurations.

### Maintenance

- To stop the bot: `docker-compose down`
- To update: Pull the latest changes, rebuild, and restart the containers.
- Monitor logs regularly: `docker-compose logs -f`

Remember to keep your `.env` file and bot token secure. Never commit them to public repositories.


## GitHub Actions CI Pipeline

### Overview
Expand Down

0 comments on commit f564e9e

Please sign in to comment.