Skip to content

Commit

Permalink
Version 2.0
Browse files Browse the repository at this point in the history
### Version 2.0
* Added cogs
* Added f-strings and removed `.format()`
* Created [config file](config.py) for easier setup
  • Loading branch information
kkrypt0nn committed Sep 9, 2020
1 parent 367a149 commit 22db713
Show file tree
Hide file tree
Showing 10 changed files with 826 additions and 492 deletions.
139 changes: 139 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,140 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

.idea/*
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018-2019 Krypton
Copyright 2020 Krypton

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
73 changes: 54 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,69 @@
# Python-Discord-Bot-Template
# Python Discord Bot Template
[![Python Versions](https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8-orange)](https://github.com/kkrypt0nn/Python-Discord-Bot-Template) [![Project Version](https://img.shields.io/badge/version-v2.0-blue)](https://github.com/kkrypt0nn/Python-Discord-Bot-Template)

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

The list of update are available [here](UPDATES.md).
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. But there wasn't any existing template. That's why I decided to create my own template to let <b>you</b> guys create your discord bot in an easy way.

## Bots who used this template
## Authors
* **[Krypton (@kkrypt0nn)](https://github.com/kkrypt0nn)** - The only and one developer

*DM Krypton#2188 to get yourself in this list*
## Support

If you need some help for something, do not hesitate to join my discord server [here](https://discord.gg/xkWRGBY).

## How to use it
All the updates of the template are available [here](UPDATES.md).

## How to download it

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

Alternatively you can do the following:
* Clone/Download the repository
* Create a discord bot [here](https://discordapp.com/developers/applications)
* To clone it and get the updates you can definitely use the command
`git clone`
* Create a discord bot [here](https://discord.com/developers/applications)
* Get your bot token
* Put the bot token in the python file at the line 14
* Invite your bot on servers using the following invite:
https://discordapp.com/oauth2/authorize?&client_id=YOUR_APPLICATION_ID_HERE&scope=bot&permissions=8
Replace `YOUR_APPLICATION_ID_HERE` witht the application ID
* Then open terminal/command prompt and run the bot using: `python3 bot.py`
https://discordapp.com/oauth2/authorize?&client_id=YOUR_APPLICATION_ID_HERE&scope=bot&permissions=8 (Replace `YOUR_APPLICATION_ID_HERE` with the application ID)

## How to setup

## Things to edit
Make sure to edit those things:
* `BOT_PREFIX` with the prefix you want
* `TOKEN` with your bot token
* `OWNER` with your user discord ID
* `BLACKLIST` with the user discord IDs of people that should not be able to use the bot commands
To setup the bot I made it as simple as possible. I now created a [config.py](config.py) file where you can put the needed things to edit.

Here is an explanation of what everything is:

| Variable | What it is |
| ------------------| ----------------------------------------------------------------------|
| BOT_PREFIX | The prefix(es) of your bot |
| TOKEN | The token of your bot |
| APPLICATION_ID | The application ID of your bot |
| OWNERS | The user ID of all the bot owners |
| BLACKLIST | The user ID of all the users who can't use the bot |
| STARTUP_COGS | The cogs that should be automatically loaded when you start the bot |

## How to start

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

If you have multiple versions of python installed (2.x and 3.x) then you will need to use the following command:
```
python3 bot.py
```
or eventually
```
python3.8 bot.py
```
<br>

If you have just installed python today, then you just need to use the following command:
```
python bot.py
```

## Built With

* [Python 3](https://www.python.org/) - Used Python 3
* [Python 3.8](https://www.python.org/)

## Issues or Questions

Expand All @@ -38,9 +73,9 @@ If you have any issues or questions of how to code a specific command, make sure

We use [SemVer](http://semver.org) for versioning. For the versions available, see the [tags on this repository](https://github.com/kkrypt0nn/Python-Discord-Bot-Template/tags).

## Author(s)
## Bots who used this template

* **[Krypton](https://spacelab.wtf)** - The only and one developer
*DM Krypton#2188 to get yourself in this list*

## License

Expand Down
5 changes: 5 additions & 0 deletions UPDATES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Updates List
Here is the list of all the updates that I made on this template.

### Version 2.0
* Added cogs
* Added f-strings and removed `.format()`
* Created [config file](config.py) for easier setup

### Version 1.2
* Added blacklist command
* Removed commands cooldown
Loading

5 comments on commit 22db713

@Twisted-Code
Copy link

@Twisted-Code Twisted-Code commented on 22db713 Sep 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you got around to implementing cogs. Sweet :-)
in addition to the PR of mine you closed this morning, I had a few other changes to suggest. Though, it looks like I'll have to rewrite them a little bit to work with the new version. For instance, I got that command line input thing I was working on (remember the DM I sent you asking for help with asyncio?) to work (well, mostly. I may need to add something to the Shutdown command to kill the input coroutine). Want me to let you know when I open a PR for you to check out?

@kkrypt0nn
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A command line input running on async is not in my mind. This is just a template to start your bot. So implementing that would be better to make your own copy of the template and create your bot.

@Twisted-Code
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough. But that wasn't my only suggestion anyway: I also had at least 1 small tweak to the status task. Rather than describe it though, I may as well PR it and save you the trouble since I'm going to use it myself

@kkrypt0nn
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just open a PR, I will either accept or deny it.
If you wish to talk with me just get on my discord server. Can be found in the README.md file ^^

@Twisted-Code
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup I noticed. I was about to join as soon as I update my fork.

Please sign in to comment.