An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          


Watch2Gether Bot Logo

Watch2Gether Discord Bot



GitHub stars


GitHub forks


GitHub issues

## 📚 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


Main


Create
Add


Room List
Share Invite


Delete Rooms
Admin Panel


Logger

## 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)!



ko-fi