https://github.com/cfunkz/watch2gether-discord-bot
A simple Watch2Gether room manager for Discord.
https://github.com/cfunkz/watch2gether-discord-bot
aiohttp aiosqlite appcommands bot bots botsfordiscord discord discord-bot discordpy discordpython python python3 sqlite sqlite3 watch2gether
Last synced: about 1 month ago
JSON representation
A simple Watch2Gether room manager for Discord.
- Host: GitHub
- URL: https://github.com/cfunkz/watch2gether-discord-bot
- Owner: cfunkz
- Created: 2025-07-27T19:27:54.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-27T21:17:59.000Z (11 months ago)
- Last Synced: 2025-07-27T21:31:44.644Z (11 months ago)
- Topics: aiohttp, aiosqlite, appcommands, bot, bots, botsfordiscord, discord, discord-bot, discordpy, discordpython, python, python3, sqlite, sqlite3, watch2gether
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Watch2Gether Discord Bot
## 📚 Table of Contents
- [Features](#features)
- [Setup](#setup)
- [Usage](#usage)
- [Admin Panel](#admin-panel)
- [Manage Rooms](#manage-rooms)
- [Images](#images)
- [About the Developer](#about-the-developer)
# Features
- Create new temporary rooms via Watch2Gether.
- Link existing Watch2Gether rooms.
- Validate and verify Watch2Gether URLs using **regular expressions (regex)**.
- Manage multiple rooms per user with limits.
- Add videos to playlist.
- Instant play a video.
- Download & Dump local database and reload bot cogs via admin panel.
- Uses **aiohttp** for asynchronous HTTP requests.
- Uses **aiosqlite** for asynchronous database operations, enabling concurrency.
- Employs Discord **modals**, **select menus**, and **options** for interactive user input and command handling.
- Simple Admin Panel for database management and reloading cogs.
- Custom logger
# Setup
**API KEY:** Get your Watch2Gether API key from your account page:
[W2G Profile Page](https://w2g.tv/en/account/edit_user/)
**Discord Bot Token:** Create a bot on the Discord Developer Portal:
[DISCORD API](https://discord.com/developers/applications)
```bash
git clone https://github.com/cfunkz/Watch2Gether-Discord-Bot.git
cd Watch2Gether-Discord-Bot
```
Create and activate a Python virtual environment
```bash
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
.\.venv\Scripts\activate # Windows PowerShell
```
Install dependencies
```bash
pip install -r requirements.txt
```
Configure your environment
Edit `config.py` with:
```python
W2G_API_KEY = "WATCH2GETHER KEY"
BOT_TOKEN = "DISCORD TOKEN"
DB_FILE = "user_rooms.db" # Database file path
GUILD_ID = 1234567890000000001 # Your server ID
ROLE_ID = 1234567898098766554 # Admin Role ID that should have access
MAX_LOG_SIZE = 33554432 # Maximum LOG SIZE in bytes (32 MB)
ROTATE_LOGS = 5 # HOW MANY LOGS TO ROTATE
LOG_FILE = 'discord.log'
DEFAULT_AVATAR = "https://i.ibb.co/TMnHDzL2/watchparty.png" # Default avatar URL
MAX_USER_ROOM = 10
```
Run the bot
```bash
python main.py
```
> ⚠️ **Note**: Ensure you have the required permissions for the bot in your Discord server. Don't forget to set admin role and guild in the `.env` or `config.py`.
# Usage
## Admin Panel
Run `/admin` to open a private panel with buttons for:
- Downloading or dumping the database
- Checking ping
- Reloading cogs
## Manage Rooms
Use the `/watch` command to manage Watch2Gether rooms.
The bot can create a temporary room, link existing rooms, share, delete rooms, add to playlist and instant play a video from discord.
# Images
## About the Developer
Built with ❤️ by [cfunkz](https://github.com/cfunkz) — learning the wizardry of Debian, Python & SQL.
If this project helped you, consider ⭐ starring the repo or [buying me a coffee](https://ko-fi.com/cfunkz81112)!