Skip to content

RicoCTY/Python-DiscordBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python Discord Bot

Python Discord.py License Stars Forks

Bot logo

๐ŸŽฏ Overview

A feature-rich Discord bot that combines AI chat capabilities with music playback features. Perfect for enhancing your Discord server with intelligent conversations, entertainment, and utility functions.

๐ŸŒŸ Key Features

  • ๐Ÿค– AI Chat: Engage in natural conversations with context awareness
  • ๐ŸŽต Music Player: High-quality music playback with queue management
  • ๐ŸŽฎ Fun Games: Interactive games like 8ball, rock-paper-scissors, and more
  • ๐Ÿ›ก๏ธ Auto-Moderation: Keep your server safe with customizable moderation tools
  • ๐ŸŽ‰ Giveaways: Create and manage giveaways with ease
  • ๐Ÿ“… Birthday System: Never miss a member's birthday celebration
  • ๐ŸŽค Text-to-Speech: Convert text messages to voice

๐Ÿš€ Installation Guide

Prerequisites

  • Python 3.8 or higher
  • Discord Bot Token
  • HuggingFace Access Token
  • FFmpeg (for music features)
  • Git

Step 1: Clone the Repository

git clone https://github.com/RicoCTY/Python-DiscordBot.git
cd Python-DiscordBot

Step 2: Set Up Virtual Environment

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\activate

# On macOS/Linux:
source venv/bin/activate

Step 3: Install Dependencies

pip install -r requirements.txt

Step 4: Configure Environment Variables

Create a .env file in the root directory with the following variables:

# Discord Bot Configuration
DISCORD_TOKEN=your_bot_token_here

# AI Model Configuration
HUGGINGFACE_TOKEN=your_huggingFace_token

Step 5: Run the Bot

Windows:

python main.py

macOS/Linux:

python3 main.py

๐Ÿ› ๏ธ Development

Project Structure

Python-DiscordBot/
โ”œโ”€โ”€ cogs/           # Command modules
โ”‚   โ”œโ”€โ”€ fun.py      # Fun commands
โ”‚   โ”œโ”€โ”€ music.py    # Music features
โ”‚   โ”œโ”€โ”€ tools.py    # Utility commands
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ config/         # Configuration files
โ”œโ”€โ”€ utils/          # Helper functions
โ”œโ”€โ”€ data/           # Data storage
โ””โ”€โ”€ main.py         # Bot entry point

๐Ÿ“‹ Command List

๐ŸŽฎ Fun Commands

Command Description Usage
/8ball Ask the magic 8-ball a question /8ball Will I win the lottery?
/coinflip Flip a coin /coinflip
/roll Roll a dice /roll 20
/rps Play rock-paper-scissors /rps rock

๐Ÿ› ๏ธ Utility Commands

Command Description Usage
/hello Get a friendly greeting /hello
/ping Check the bot's latency /ping
/poll Create a poll with up to 10 options /poll "Best season?" "Summer" "Winter" "Spring" "Fall"
/giveaway Create a giveaway /giveaway "PS5" 60 1
/set_birthday Set your birthday /set_birthday 12 25
/view_birthdays View all registered birthdays /view_birthdays
/tts Convert text to speech /tts Hello everyone!
/remind Set a reminder /remind "Submit report" 2h
/reminders View your active reminders /reminders

๐ŸŽต Music Commands

Command Description Usage
/play Play a song /play https://youtube.com/...
/skip Skip the current song /skip
/stop Stop playback and clear queue /stop
/pause Pause the current song /pause
/volume Adjust playback volume /volume 50
/queue View the current music queue /queue

๐Ÿ‘ค Information Commands

Command Description Usage
/userinfo Get detailed user information /userinfo @user
/avatar Get a user's avatar /avatar @user

โš™๏ธ Admin Commands

Command Description Usage
/shutdown Shutdown the bot (owner only) /shutdown
/setup_welcome Set the welcome channel /setup_welcome #welcome-channel
/setup_goodbye Set the goodbye channel /setup_goodbye #goodbye-channel
/role_menu Create a reaction role menu /role_menu "Game Roles" "Select your games"
/automod_setup Configure AutoMod settings /automod_setup
/add_banned_word Add a banned word /add_banned_word example
/remove_banned_word Remove a banned word /remove_banned_word example
/list_banned_words View all banned words /list_banned_words
/download_backup Download server backup /download_backup
/create_backup Create server backup /create_backup
/edit_menu_description Edit role menu description /edit_menu_description "New description"
/edit_menu_title Edit role menu title /edit_menu_title "New title"
/view_backup View available backups /view_backup
/aiChat Chat with AI /aiChat What's the meaning of life?

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/NewFeature)
  3. Commit your changes (git commit -m 'Add some New Feature')
  4. Push to the branch (git push origin feature/NewFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ’ฌ Support

If you encounter any issues or have questions, please:

  1. Check the Issues page
  2. Create a new issue if your problem isn't already listed

๐Ÿ™ Acknowledgments

  • discord.py - The Discord API wrapper
  • yt-dlp - YouTube downloader
  • All contributors and users of this bot