Skip to main content

Botstrap: Logo (Link to Website)

Botstrap

Development Status Botstrap: Latest Version Supported Python Versions
CodeQL Workflow Read the Docs Tests Workflow
CodeFactor: Code Quality Codacy: Code Quality Codecov: Test Coverage

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.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.)

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.

Metadata

Release files for botstrap 0.2.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for botstrap 0.2.9
File Size Uploaded
botstrap-0.2.9.tar.gz 306.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for botstrap 0.2.9
File Interpreter ABI Platform
botstrap-0.2.9-py3-none-any.whl Python 3 none any Details

Total release size: 371.0 kB

Release files / botstrap-0.2.9.tar.gz

Download URL botstrap-0.2.9.tar.gz
Size 306.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0b7f2ecd4840c89a93f84faa217810e9ad9f6543aecf36989185bd05984c9b4f
BLAKE2b-256 checksum
How to use checksums
780dba243f0d40f8d3bbb1e50a2c55db56b0e6b1a133b8f95f3c3f2bf95484f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / botstrap-0.2.9-py3-none-any.whl

Download URL botstrap-0.2.9-py3-none-any.whl
Size 64.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
673cbdc4dce2659af3b892c630e4ebdd15558707dcab1d85380a83af1ed03935
BLAKE2b-256 checksum
How to use checksums
889ceab135d4ffe0a6a2d55ad4982283198c9615eca95f570882c547cb5ba664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release history Release notifications | RSS feed

This release

0.2.9 This release

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page