Beginner-friendly Discord bot built with the latest discord.py — featuring prefix commands, slash commands, and event handlers
- 🎮 Prefix Commands – Classic
!pingstyle commands for quick testing and familiar usage - ⚡ Slash Commands – Modern, discoverable commands powered by Discord's Interaction API
- 📡 Event Handlers – React to Discord events like
on_message,on_ready,on_member_join, and more - 📝 Fully Typed – Utilizes Python type hints for better IDE support, autocomplete, and code readability
- 🐳 Docker Ready – Includes a minimal Dockerfile for containerized deployment
- 🔄 GitHub Actions CI – Automated testing and deployment workflow included
- 🚀 Production-Ready – Robust error handling and logging built-in
- 📦 Minimal Dependencies – Lightweight with only essential packages
- Python 3.8+ - Programming language
- discord.py 2.3+ - Discord API wrapper
- python-dotenv - Environment variable management
- Docker - Containerization (optional)
- Python 3.8 or higher
- A Discord bot token (Create one here)
- Git (for cloning the repository)
# Clone the repository
git clone https://github.com/IN3PIRE/pn.git
cd pn
# Create a virtual environment
python -m venv .venv
# Activate the virtual environment
# On Linux/macOS:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Install discord.py
pip install -U discord.py python-dotenv- Rename
.env.exampleto.env - Replace
YOUR_BOT_TOKENwith your bot token - (Optional) Configure other variables as needed
# On Linux/macOS:
cp .env.example .env
# On Windows:
copy .env.example .envpython bot.pyClassic command style using ! prefix:
@bot.command()
async def ping(ctx):
"""Simple ping command to check bot latency"""
latency = round(bot.latency * 1000)
await ctx.send(f'Pong! {latency}ms')Modern Discord interactions:
@bot.tree.command(name='hello', description='Say hello to someone')
async def hello(interaction: discord.Interaction, name: str):
await interaction.response.send_message(f'Hello, {name}! 👋')Respond to Discord events:
@bot.event
async def on_ready():
print(f'✅ Logged in as {bot.user}')
print(f'📊 Connected to {len(bot.guilds)} guilds')
@bot.event
async def on_message(message):
if message.author == bot.user:
return
if 'hello' in message.content.lower():
await message.reply('Hello there! 👋')
await bot.process_commands(message)pn/
├── bot.py # Main bot file
├── cogs/ # Command modules (optional)
│ └── example.py
├── .env.example # Environment template
├── .gitignore # Git ignore rules
├── Dockerfile # Docker configuration
├── LICENSE # MIT License
├── README.md # Documentation
├── requirements.txt # Python dependencies
└── .github/
└── workflows/
└── ci.yml # GitHub Actions workflow
We welcome contributions! Please see our detailed Contributing Guide for:
- 🌟 Star Requirement: Must star repo before PR merge
- 📝 Step-by-step contribution process
- ✅ Code standards and best practices
- 🏷️ Issue labels and assignment process
- 🧪 Testing guidelines
- ⭐ Star the repository (click the star button at the top-right) - Required for PR merge
- Find an issue: Look for
good first issueorhelp wantedlabels - Comment: Say "I would like to work on this" on the issue
- Wait for assignment: Don't start until officially assigned
- Fork & branch: Create a feature branch (
feature/amazing-feature) - Code & test: Follow our coding standards
- Submit PR: Fill out the PR template completely
good first issue- Perfect for newcomershelp wanted- Extra attention neededbug- Something isn't working correctlyenhancement- New feature or improvementdocumentation- Docs need updatinghigh priority- Needs immediate attention
Starring:
- ✨ Shows support for the project
- 👤 Verifies you're a human contributor
- 🫂 Makes you part of our contributor team
- 📈 Helps the project grow and gain visibility
- 🏆 Recognizes you as an active community member
We consider all stargazers as part of our contributor team!
- Comment on any issue you're interested in
- Check existing PRs for implementation examples
- Read the discord.py Guide
- Join our discussions or create a new issue
This project is licensed under the MIT License – see the LICENSE file for details.
If you find this project helpful, please consider giving it a ⭐ star on GitHub!
Made with ❤️ and ☕ by the IN3PIRE Team
View our other projects • Join our Discord community
Happy coding! 🚀

