Skip to main content

An easy-to-use utility toolbelt for Discord bots written in Python.

Project description

Botstrap Logo

Botstrap

Development Status Latest Version Supported Python Versions
Tests Docs CodeQL
Codacy Codecov Libraries.io

An easy-to-use utility toolbelt for Discord bots written in Python.
Read the docs »

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!

Installation

Python 3.10 or higher is required. It's also generally a good idea to upgrade pip (python -m pip install -U pip).

pip install -U botstrap

For additional/alternative installation instructions, see the documentation.

Quickstart

Coming soon! In the meantime, check out:

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:

- repo: https://github.com/nuztalgia/botstrap
  rev: 0.2.6
  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.)

Badges

Let everyone know your Discord bot is secure by adding a badge to your repository's README.md:

Botstrap: On Botstrap: Enabled Tokens: Encrypted Tokens: Secure Botstrap

[![Botstrap](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fnuztalgia%2Fbotstrap%2Fmain%2F.github%2Fbadges%2Fbotstrap-on.json)](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.

License

Copyright © 2022 Nuztalgia. Released under the Apache License, Version 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

botstrap-0.2.6.tar.gz (136.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

botstrap-0.2.6-py3-none-any.whl (60.4 kB view details)

Uploaded Python 3

File details

Details for the file botstrap-0.2.6.tar.gz.

File metadata

  • Download URL: botstrap-0.2.6.tar.gz
  • Upload date:
  • Size: 136.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for botstrap-0.2.6.tar.gz
Algorithm Hash digest
SHA256 1cd63151f7868c28baaad6d8d6af42563fceef6957f7ce98418f330c829b1a70
MD5 389ea11b46d73be95578c9e5f81e27ee
BLAKE2b-256 684d0fc3b6c4b669a6823578a4d4c9498135de736bd048cab7e5a67f0a153c65

See more details on using hashes here.

File details

Details for the file botstrap-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: botstrap-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 60.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for botstrap-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 77bd9a65d4536216f7835925f2c4742856c45458e3a82092495093d99dfaa97a
MD5 40cd22633237c802c771a82a02929e5d
BLAKE2b-256 371f45a4857e4e93a47ec8cf086e7bcc2fa8438135c2f30df6a354c03d2b76d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page