bpm is a self-hosted Discord bot designed to help you manage your PC remotely. Currently, it focuses on torrent management via qBittorrent, but the goal is to expand its capabilities to allow you to control and automate various aspects of your computer directly from Discord.
- Discord bot integration
- Manage torrents via Discord commands
- Add torrents (currently supports qBittorrent)
- Environment-based configuration
- Graceful shutdown handling
- PC management commands
- More torrent clients
- Custom automation via Discord
- Clone the repository:
git clone <your-repo-url> cd bpm
- Set up environment variables:
The bot uses environment variables for configuration. You can set them directly in your shell or use a
.envfile. See the configuration section below for details. - Build and run:
go build -o bpm ./bpm
You need a Discord bot token and the bot must be invited to your server.
-
Create a Discord bot:
- Go to Discord Developer Portal
- Create a new application and add a bot
- Copy the bot token
-
Invite the bot to your server:
- In the Developer Portal, go to "OAuth2 > URL Generator"
- Select "bot" scope and set permissions as needed (e.g., Send Messages, Read Message History)
- Use the generated URL to invite the bot
-
Set environment variables for Discord config: The following environment variables are required:
DISCORD_TOKEN: Your bot token
-
Run slash command
/setupin your discord server This command will configure essential information, such as the guild ID, for your server.
Example .env file:
BPM_DISCORD_TOKEN=<bot-token>
BPM_TORRENT_QBITORRENT_HOST=localhost
BPM_TORRENT_QBITORRENT_PORT=8080
BPM_TORRENT_QBITORRENT_USER=admin
BPM_TORRENT_QBITORRENT_PASS=adminThe bot uses the following environment variables (see main.go):
- Discord config:
DISCORD_* - qBittorrent config:
TORRENT_HOST,TORRENT_PORT,TORRENT_CREDENTIALS_USERNAME,TORRENT_CREDENTIALS_PASSWORD
MIT
- [-] Torrent management
- PC management commands
- GuildID from envvars
- Generate Docker Image