A comprehensive Discord bot designed for the GirlScript Summer of Code (GSSoC) and Winter of Blockchain (WoB) communities. This bot provides automated user verification, role management, moderation tools, and administrative capabilities to streamline community management.
- Email-based verification: Automated user verification using registered email addresses from Excel data sources
- Multi-tier role assignment: Supports Contributors, Campus Ambassadors, Mentors, and Project Admins for both GSSoC and WoB programs
- Role hierarchy management: Intelligent role priority system with conflict resolution
- Failed attempt tracking: Comprehensive logging of verification failures for security monitoring
- Username standardization: Automatic username formatting to maintain community standards
- User management: Ban, kick, and timeout commands with configurable durations and reason logging
- Warning system: Progressive warning tracking with persistent storage and escalation capabilities
- Message cleanup: Bulk message deletion and channel management tools
- Permission-based access: Role-based command restrictions for administrative functions
- Dynamic channel creation: Create text channels with customizable settings including slowmode, NSFW flags, and topics
- Category organization: Organize channels within specific categories
- Bulk operations: Mass channel management and configuration updates
- Excel integration: Supports multiple Excel data sources for different participant categories
- In-memory caching: Optimized data loading with startup caching for improved performance
- Unverified member caching: Administrative tools to identify and manage users requiring verification
- Persistent logging: JSON-based storage for verification logs, welcome messages, and user activities
- Welcome automation: Automated welcome messages with cleanup tasks for new members
- Logging system: Comprehensive action logging to designated channels
- Background tasks: Automated maintenance operations including message cleanup
- Environment configuration: Extensive configuration management via environment variables
/verify <email>- Verify user registration with email address/adminverify <user> <email>- Administrative verification for specific users/cacheunverified- Cache members requiring verification (admin only)
/ban <user> [reason]- Ban user from server with optional reason/kick <user> [reason]- Remove user from server/timeout <user> <duration> <unit> [reason]- Temporary restriction (minutes/hours/days)/warn <user> [reason]- Issue warning to user with tracking/warnings <user>- View user's warning history/clearwarnings <user>- Clear user's warning record
/addrole <user> <role> [reason]- Assign role to user/removerole <user> <role> [reason]- Remove role from user
/createchannel <name>- Create new text channel with optional configuration/deletechannel <channel>- Remove specified channel/cleanup <amount>- Delete specified number of messages
/about- Display bot information and developer details
The bot integrates with multiple Excel files located in the Excel-Sheets directory:
Excel-Sheets/
├── contributor_Data.xlsx # GSSoC Contributors
├── contributors_wob.xlsx # WoB Contributors
├── CA.xlsx # Campus Ambassadors (Primary)
├── CA2.xlsx # Campus Ambassadors (Extended)
├── CA_wob.xlsx # WoB Campus Ambassadors
├── MENTOR.xlsx # GSSoC Mentors
├── MENTORS_wob.xlsx # WoB Mentors
├── PA.xlsx # GSSoC Project Admins
└── PA_wob.xlsx # WoB Project Admins
GSSoC-Manager-Bot/
├── bot.py # Main bot entry point and event handlers
├── bot-test.py # Development testing version
├── excel_handler.py # Excel data processing and role assignment logic
├── requirements.txt # Python dependencies
├── commands/ # Modular command implementations
│ ├── __init__.py
│ ├── about.py # Bot information command
│ ├── channel.py # Channel management commands
│ ├── moderation.py # Ban, kick, timeout commands
│ ├── role.py # Role assignment commands
│ ├── timeout.py # User timeout functionality
│ └── warn.py # Warning system implementation
├── Verification_Module/ # Core verification system
│ ├── __init__.py
│ └── verify.py # Email verification and user management
├── Excel-Sheets/ # User data sources (not tracked in git)
├── Logos/ # Bot assets and community logos
└── Data Files (auto-generated):
├── welcome_messages.json # Welcome message tracking
├── verification_loga.json # Verification activity logs
├── username_updates.json # Username change history
├── failed_attempts.json # Failed verification attempts
└── warnings.json # User warning records
- Python 3.8 or higher
- Discord application with bot token
- Excel files with participant data
- Clone the repository
git clone https://github.com/jindalpriyanshu101/GSSoC-Manager-Bot.git
cd GSSoC-Manager-Bot- Install dependencies
pip install -r requirements.txt- Environment Configuration
Create a
.envfile in the root directory with the following variables:
# Discord Configuration
DISCORD_TOKEN=your_discord_bot_token
DISCORD_GUILD_ID=your_guild_id
DISCORD_VERIFICATION_CHANNEL_ID=verification_channel_id
WELCOME_CHANNEL_ID=welcome_channel_id
LOG_CHANNEL_ID=log_channel_id
# Role Configuration
AUTO_ASSIGNED_ROLE_ID=unverified_role_id
ROLE_CONTRI=contributor_role_id
ROLE_CONTRI_WOB=wob_contributor_role_id
ROLE_CA=campus_ambassador_role_id
ROLE_CA_WOB=wob_campus_ambassador_role_id
ROLE_MENTOR=mentor_role_id
ROLE_MENTOR_WOB=wob_mentor_role_id
ROLE_PA=project_admin_role_id
ROLE_PA_WOB=wob_project_admin_role_id
# Administrative Configuration
ADMIN_IDS=comma_separated_admin_user_ids- Data Setup
mkdir Excel-Sheets
# Add your Excel files to the Excel-Sheets directory- Run the bot
python bot.py- discord.py: Discord API integration with full feature support
- pandas: Excel data processing and manipulation
- python-dotenv: Environment variable management
- openpyxl: Excel file reading capabilities
- aiosmtplib: Asynchronous email functionality
- Modular design: Separated command modules for maintainability
- Hybrid commands: Support for both slash commands and traditional prefix commands
- Event-driven: Utilizes Discord.py event system for real-time responses
- Asynchronous operations: Non-blocking operations for optimal performance
- Error handling: Comprehensive error management with user-friendly feedback
- Startup caching: Excel data loaded into memory at bot initialization
- Background tasks: Automated cleanup and maintenance operations
- Optimized queries: Efficient role and permission checking
- Minimal API calls: Reduced Discord API usage through intelligent caching
Commands are organized in the commands/ directory. To add a new command:
- Create a new Python file in the
commands/directory - Implement the setup function with command logic
- The bot automatically loads all command modules
Example command structure:
# commands/example.py
import discord
import os
from discord.ext import commands
def setup(bot, tree, bot_data, admin_ids, homies):
guild_id = int(os.getenv('DISCORD_GUILD_ID'))
@bot.hybrid_command(
name="example",
description="Example command description"
)
@commands.guild_only()
async def example_command(ctx, parameter: str):
# Command implementation
await ctx.send(f"Example response: {parameter}")- JSON files: Used for logging and temporary data storage
- Excel integration: Primary data source for user verification
- Environment variables: Configuration management
- In-memory caching: Performance optimization for frequently accessed data
- Permission-based access: Commands restricted based on Discord permissions
- Admin verification: Special administrative command access control
- Audit logging: Comprehensive action logging for security monitoring
- Rate limiting: Built-in Discord.py rate limiting for API protection
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
For issues, questions, or feature requests:
- Create an issue on GitHub
- Contact me here
- Review the documentation and command help
This project is licensed under the MIT License. See the LICENSE file for details.
Developed for the GirlScript Summer of Code (GSSoC - 2024) and Winter of Blockchain (WoB - 2024) communities to enhance community management and user experience. by Priyanshu