• Stars
    star
    892
  • Rank 51,172 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐍 A simple template to start to code your own and personalized Discord bot in Python

Python Discord Bot Template

This repository is a template that everyone can use for the start of their discord bot.

When I first started creating my discord bot it took me a while to get everything setup and working with cogs and more. I would've been happy if there were any template existing. However, there wasn't any existing template. That's why I decided to create my own template to let you guys create your discord bot easily.

Please note that this template is not supposed to be the best template, but a good template to start learning how discord.py works and to make your own bot easily.

If you plan to use this template to make your own template or bot, you have to:

  • Keep the credits, and a link to this repository in all the files that contains my code
  • Keep the same license for unchanged code

See the license file for more information, I reserve the right to take down any repository that does not meet these requirements.

Support

Before requesting support, you should know that this template requires you to have at least a basic knowledge of Python and the library is made for advanced users. Do not use this template if you don't know the basics. Here's a link for resources to learn python.

If you need some help for something, do not hesitate to join my discord server here.

All the updates of the template are available here.

Disclaimer

Slash commands can take some time to get registered globally, so if you want to test a command you should use the @app_commands.guilds() decorator so that it gets registered instantly. Example:

@commands.hybrid_command(
  name="command",
  description="Command description",
)
@app_commands.guilds(discord.Object(id=GUILD_ID)) # Place your guild ID here

When using the template you confirm that you have read the license and comprehend that I can take down your repository if you do not meet these requirements.

Please do not open issues or pull requests about things that are written in the TODO file, they are already under work for a future version of the template.

How to download it

This repository is now a template, on the top left you can simply click on "Use this template" to create a GitHub repository based on this template.

Alternatively you can do the following:

How to set up

To set up the bot I made it as simple as possible. I now created a config.json file where you can put the needed things to edit.

Here is an explanation of what everything is:

Variable What it is
YOUR_BOT_PREFIX_HERE The prefix you want to use for normal commands
YOUR_BOT_TOKEN_HERE The token of your bot
YOUR_BOT_PERMISSIONS_HERE The permissions integer your bot needs when it gets invited
YOUR_APPLICATION_ID_HERE The application ID of your bot
OWNERS The user ID of all the bot owners

How to start

To start the bot you simply need to launch, either your terminal (Linux, Mac & Windows), or your Command Prompt ( Windows) .

Before running the bot you will need to install all the requirements with this command:

python -m pip install -r requirements.txt

After that you can start it with

python bot.py

Note You may need to replace python with py, python3, python3.11, etc. depending on what Python versions you have installed on the machine.

Issues or Questions

If you have any issues or questions of how to code a specific command, you can:

  • Join my discord server here
  • Post them here

Me or other people will take their time to answer and help you.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Built With

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details

More Repositories

1

wordlists

πŸ“œ A collection of wordlists for many different usages
1,134
star
2

spaceflake

β›„ A distributed generator to create unique IDs with ease in Go; inspired by Twitter's Snowflake
Go
40
star
3

swiss-army-knife

πŸ”ͺ Swiss Army Knife is a Go library containing multiple packages that I often use for my projects.
Go
5
star
4

time-wasted-counter

πŸ•° Have you ever wondered for how long you just wasted time at doing something? Visit this website and you will know for how long you've been wasting time, all of this with a cool background music :)
HTML
4
star
5

kkrypt0nn

2
star
6

gomanuf

πŸ“‡ A very simple Go library to get the manufacturer of a specific MAC address
Go
2
star
7

rsmanuf

πŸ“‡ A very simple Rust library to get the manufacturer of a specific MAC address
Rust
2
star
8

project-serpens

πŸ‘οΈ Uncover the unseen
Rust
2
star
9

spaceflake.rs

β›„ A distributed generator to create unique IDs with ease in Rust; inspired by Twitter's Snowflake
Rust
2
star
10

centauri

✨ Centauri is a Discord API wrapper written in Go with the goal of being easily understandable and simple to use, even for newcomers
Go
2
star
11

go.krypton.ninja

πŸš† A website made for redirects to go quickly on some website or social media
HTML
1
star
12

x

πŸ§ͺ A repository for all my experiments, tests, learning "projects" and similar random things
Rust
1
star
13

tangra.rs

πŸͺ΅ A lightweight and easy to use Rust logging library
Rust
1
star
14

rust-boilerplate

πŸ¦€ A Rust boilerplate made to simplify the creation of my projects
Rust
1
star
15

kr

πŸ” A lightweight implementation of a Semaphore in Rust
Rust
1
star