https://github.com/nuztalgia/botstrap
An easy-to-use utility toolbelt for Discord bots written in Python.
https://github.com/nuztalgia/botstrap
beginner-friendly bot bot-framework botstrap cli command-line discord discord-bot easy-to-use encryption python python-3 python-library secure security utilities
Last synced: about 1 year ago
JSON representation
An easy-to-use utility toolbelt for Discord bots written in Python.
- Host: GitHub
- URL: https://github.com/nuztalgia/botstrap
- Owner: nuztalgia
- License: apache-2.0
- Created: 2022-07-20T03:33:45.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T19:09:57.000Z (about 1 year ago)
- Last Synced: 2025-04-13T01:51:40.941Z (about 1 year ago)
- Topics: beginner-friendly, bot, bot-framework, botstrap, cli, command-line, discord, discord-bot, easy-to-use, encryption, python, python-3, python-library, secure, security, utilities
- Language: Python
- Homepage: https://botstrap.readthedocs.io/
- Size: 871 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: .github/contributing.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://botstrap.readthedocs.io)
# Botstrap
[](https://pypi.org/project/botstrap/)
[](https://pypi.org/project/botstrap/)
[](https://pypi.org/project/botstrap/)
[](https://github.com/nuztalgia/botstrap/actions/workflows/codeql.yml)
[](https://readthedocs.org/projects/botstrap)
[](https://github.com/nuztalgia/botstrap/actions/workflows/tests.yml)
[](https://codefactor.io/repository/github/nuztalgia/botstrap)
[](https://app.codacy.com/gh/nuztalgia/botstrap)
[](https://app.codecov.io/github/nuztalgia/botstrap)
An easy-to-use utility toolbelt for Discord bots written in Python.
[**Read the docs ยป**](https://botstrap.readthedocs.io)
## Overview
Do you store your Discord bot token in [plaintext]? Don't get caught with your pants
down. Strap in!
**Botstrap** is a ~~Python library~~ suit of power armor that perfectly fits your
Discord bot. It offers:
- ๐ **Secure encryption** and password protection to keep your bot tokens safe
- ๐คน A straightforward way to **manage multiple tokens** and/or bot configurations
- ๐ An intuitive, colorful, and customizable **command-line interface** for your bot
- ๐ค Out-of-the-box **compatibility** with all of the most popular Python [Discord
libraries]
- ... and more to come!
[plaintext]: https://en.wikipedia.org/wiki/Plaintext
[discord libraries]: https://github.com/nuztalgia/botstrap/tree/main/examples/libraries
## Installation
Python **3.10** or higher is required. It's also generally a good idea to upgrade pip
(`python -m pip install -U pip`).
```sh
pip install -U botstrap
```
For additional/alternative installation instructions, see the [documentation].
[documentation]: https://botstrap.readthedocs.io/en/latest/getting-started/#installation
## Quickstart
Coming soon! In the meantime, check out:
- The [examples] directory
- Starter [bot templates] for various Discord libraries
- **And most importantly:** The extremely detailed [Botstrap API Reference]
[examples]: https://github.com/nuztalgia/botstrap/tree/main/examples
[bot templates]: https://github.com/nuztalgia/botstrap/tree/main/examples/libraries
[botstrap api reference]: https://botstrap.readthedocs.io/en/latest/api/
## Git Hooks
Adding one or both of Botstrap's [pre-commit] hooks to your `git` workflow is an easy
and seamless way to improve the security of your codebase. (If you're unfamiliar with
pre-commit, here's its [quickstart] guide. Highly recommend!)
See below for descriptions of the available hooks, and add the one(s) you like to your
`.pre-commit-config.yaml`:
```yaml
- repo: https://github.com/nuztalgia/botstrap
rev: 0.2.9
hooks:
- id: detect-discord-bot-tokens
- id: detect-encrypted-tokens
```
### ๐ต๏ธ `detect-discord-bot-tokens`
This hook checks the contents of your added/changed files every time you `git commit`,
and raises an error if it finds any unencrypted bot tokens. It won't catch any plaintext
tokens that you've `.gitignore`-d or already committed, but it _will_ prevent you from
accidentally committing new ones.
**Note:** This hook is especially useful for bots whose tokens aren't secured by the
main Botstrap library - **including bots written in languages other than Python!** โจ
### ๐ `detect-encrypted-tokens`
Although it isn't _quite_ as dangerous to commit your encrypted bot tokens, doing so is
still very much a security risk. This hook prevents that from happening by raising an
error if you try to `git commit` a file whose name matches the pattern used by
Botstrap's encrypted token files. (**Hint:** Keep this hook happy by adding `*.key` to
your `.gitignore`.)
[pre-commit]: https://github.com/pre-commit/pre-commit
[quickstart]: https://pre-commit.com/index.html#quick-start
## Badges
Let everyone know your Discord bot is secure by adding a badge to your repository's
`README.md`:
[](https://github.com/nuztalgia/botstrap)
[](https://github.com/nuztalgia/botstrap)
[](https://github.com/nuztalgia/botstrap)
[](https://github.com/nuztalgia/botstrap)
[](https://github.com/nuztalgia/botstrap)
```
[](https://github.com/nuztalgia/botstrap)
```
You can replace `botstrap-on` in the above snippet with the text on one of the other
badges (e.g. `tokens-secure`).
For more granular customization options, check out the available style parameters on
[shields.io](https://shields.io/#styles).
## License
Copyright ยฉ 2022 [Nuztalgia](https://github.com/nuztalgia). Released under the
[Apache License, Version 2.0](https://github.com/nuztalgia/botstrap/blob/main/LICENSE).