Skip to content

IN3PIRE/pn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


Python

๐Ÿค– PN Bot

Beginner-friendly Discord bot built with the latest discord.py โ€” featuring prefix commands, slash commands, and event handlers


Python Version Discord.py Version License Stars

โšก Quick Start โ€ข ๐ŸŽฏ Commands โ€ข ๐Ÿค Contribute โ€ข ๐Ÿ“œ License


โœจ Features

  • ๐ŸŽฎ Prefix Commands โ€“ Classic !ping style 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

๐Ÿ› ๏ธ Tech Stack


โšก Quick Start

๐Ÿ“‹ Prerequisites

  • Python 3.8 or higher
  • A Discord bot token (Create one here)
  • Git (for cloning the repository)

๐Ÿš€ Installation

# 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

๐Ÿ”ง Configuration

  1. Rename .env.example to .env
  2. Replace YOUR_BOT_TOKEN with your bot token
  3. (Optional) Configure other variables as needed
# On Linux/macOS:
cp .env.example .env

# On Windows:
copy .env.example .env

โ–ถ๏ธ Run the Bot

python bot.py

๐ŸŽฏ Commands & Events

๐ŸŽฎ Prefix Commands

Classic 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')

โšก Slash Commands

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}! ๐Ÿ‘‹')

๐Ÿ“ก Event Handlers

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)

๐Ÿ“ Project Structure

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

๐Ÿค Contributing

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

๐Ÿš€ Quick Contributing Steps

  1. โญ Star the repository (click the star button at the top-right) - Required for PR merge
  2. Find an issue: Look for good first issue or help wanted labels
  3. Comment: Say "I would like to work on this" on the issue
  4. Wait for assignment: Don't start until officially assigned
  5. Fork & branch: Create a feature branch (feature/amazing-feature)
  6. Code & test: Follow our coding standards
  7. Submit PR: Fill out the PR template completely

๐Ÿท๏ธ Issue Labels

  • good first issue - Perfect for newcomers
  • help wanted - Extra attention needed
  • bug - Something isn't working correctly
  • enhancement - New feature or improvement
  • documentation - Docs need updating
  • high priority - Needs immediate attention

๐ŸŒŸ Why Star?

โš ๏ธ IMPORTANT: You must star this repository before your PR can be merged.

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!

โ“ Need Help?

  1. Comment on any issue you're interested in
  2. Check existing PRs for implementation examples
  3. Read the discord.py Guide
  4. Join our discussions or create a new issue

๐Ÿ“œ License

This project is licensed under the MIT License โ€“ see the LICENSE file for details.


๐Ÿ™ Support

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! ๐Ÿš€

About

Beginner-friendly Discord bot with prefix commands, slash commands, and event handlers using discord.py (latest).

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors