VC Roles Logo

VC Roles: Revolutionizing Discord Voice Channels

As the sole developer of VC Roles, I've spent over four years crafting a Discord bot that transforms how servers utilize voice channels. This project has been a journey of continuous learning and improvement, resulting in a powerful tool used by 19,500+ servers with a combined 18+ million members.

Interested in learning more about VC Roles? Check out this page about the VC Roles website and dashboard.

What is VC Roles?

VC Roles is a Discord bot that enhances voice channels with features like:

  • Automatic role assignment when users join specific channels
  • Text-to-speech commands for mic-less communication
  • Dynamic voice channel generation
  • Comprehensive voice channel logging

Technical Deep Dive

Developing VC Roles has been a journey of continuous learning and improvement. Here are some key technical aspects:

Bot Stack

  • Python — primary language
  • discord.py — Discord API library
  • PostgreSQL — data storage
  • Redis — caching layer

Dashboard Stack

  • Next.js — React framework
  • TypeScript — type-safe development
  • Tailwind CSS — styling
  • tRPC — end-to-end typesafe APIs
  • Prisma ORM — database access

Architecture and Scalability

To ensure VC Roles can handle its growing user base, I implemented several key features:

  • Utilization of discord.py's AutoShardedBot for multiple gateway connections
  • Migration from JSON file storage to PostgreSQL for improved data management
  • Implementation of Redis for caching to reduce database load
  • Python in-memory cache for all database queries to reduce load
  • Transition from local hosting to a dedicated VM for increased reliability

Custom gTTS Fork

To improve the bot's responsiveness, I created a custom fork of the python gTTS library. This fork adds async support using asyncio and aiohttp, allowing TTS generation to be non-blocking and significantly improving the bot's overall performance.

Privacy and Data Handling

Privacy is a top priority for VC Roles. The bot only stores necessary data, such as user IDs for voice generator ownership, and guild, role, and channel IDs for functionality. All data is automatically removed when the bot is removed from a server.

Challenges and Learning

Developing VC Roles has been a significant learning experience. As my first major programming project, it required me to:

  • Master Python and understand efficient code structuring
  • Learn database management and migration techniques
  • Implement scalable solutions for growing user demands
  • Continuously refactor and improve the codebase

Impact and Future

VC Roles has made a significant impact on the Discord community, with:

  • 19,500+ servers trusting and using the bot
  • 18+ million combined members across those servers
  • 397 million roles changed, streamlining server management
  • 1+ million commands used

As VC Roles continues to grow, I'm committed to further enhancing its features, improving performance, and ensuring it remains a valuable tool for Discord communities of all sizes.