An open API service indexing awesome lists of open source software.

https://github.com/fallendeity/discord.py-masterclass

A tutorial/guide explaining all features in discord.py and how to make a discord bot from scratch.
https://github.com/fallendeity/discord.py-masterclass

discord-bot discord-py python tutorial

Last synced: 4 months ago
JSON representation

A tutorial/guide explaining all features in discord.py and how to make a discord bot from scratch.

Awesome Lists containing this project

README

          

# Discord.py Masterclass

[![Code formatter and linter](https://github.com/FallenDeity/discord.py-masterclass/actions/workflows/format-and-lint.yml/badge.svg)](https://github.com/FallenDeity/discord.py-masterclass/actions/workflows/format-and-lint.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python Version](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
[![discord.py](https://img.shields.io/badge/discord.py-master-blue.svg)](https://github.com/Rapptz/discord.py)

A comprehensive guide and example collection for building Discord bots with discord.py. This repository serves as a masterclass for both beginners and experienced developers looking to create feature-rich Discord bots.

## Documentation

Visit our [comprehensive documentation](https://fallendeity.github.io/discord.py-masterclass/) to learn about:

- Creating your first Discord bot
- Understanding slash commands and hybrid commands
- Working with views, buttons, and interactive components
- Implementing cogs for better code organization
- Creating custom converters and checks
- Building pagination systems
- Error handling best practices
- Audio playback functionality
- Custom help commands
- And much more! ✨

## Quick Start

### Prerequisites

- Python 3.9 or higher
- Git
- A Discord account and a bot token ([Get one here](https://discord.com/developers/applications))

### Installation

1. **Clone the repository**
```bash
git clone https://github.com/FallenDeity/discord.py-masterclass.git
cd discord.py-masterclass
```

2. **Install Poetry** (if you don't have it)
```bash
pip install poetry
```

3. **Install dependencies**
```bash
poetry install
```

4. **Windows users only**: Extra step for Cairo (required for documentation), use if cairo is giving you issues
```bash
pipwin install cairocffi
```

5. **Set up your bot token**

Create a `.env` file in the root directory:
```env
TOKEN=your_bot_token_here
```

6. **Run an example**
```bash
poetry run python examples/creating-a-bot/main.py
```

## Contributing

We love contributions! Whether you're fixing a bug, adding a new example, improving documentation, or suggesting new features, your help is appreciated.

Please read our [Contributing Guidelines](CONTRIBUTING.md) to get started. We welcome contributions of all kinds:

- Bug fixes
- New features and examples
- Documentation improvements
- Feature suggestions

## Development

### Running the Documentation Locally

```bash
poetry run mkdocs serve
```

Visit `http://127.0.0.1:8000/discord.py-masterclass/` to view the documentation.

### Code Quality

We use several tools to maintain code quality:

- **Black**: Code formatting
- **isort**: Import sorting
- **Ruff**: Fast Python linter

Run all checks:
```bash
poetry run black .
poetry run isort .
poetry run ruff check .
```

or use the pre-commit hooks:
```bash
poetry run pre-commit run --all-files
```

## Contributors

We appreciate all contributions from the community! A big thank you to everyone who has contributed to this project.



Triyan Mukherjee
Triyan Mukherjee

💻
Vitness
Vitness

💻
Mikołaj Kruczek
Mikołaj Kruczek

💻
thegamecracks
thegamecracks

💻
Enrique Bos
Enrique Bos

💻
Snipy7374
Snipy7374

💻
sarthak
sarthak

💻


Krypton
Krypton

💻

If you find this repository helpful, please consider giving it a star ⭐! It helps others discover this resource.