Beginner-friendly Discord bot built with the latest discord.py โ featuring prefix commands, slash commands, and event handlers
โก Quick Start โข ๐ฏ Commands โข ๐ค Contribute โข ๐ License
- ๐ฎ 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! ๐
