Skip to main content

Discord Self Bot Tester (BSBT) Library

Package for testing commands using discord selfbot. Assertions (messages, and autocomplete) and requests (interactions, events, reactions) can be made using the bot.

Features:

Assertions

Assertions can be made on requests. Currently, the supported assertions are: MessageAssertion, and AutoCompleteAssertion. Each assertion has a respective builder class which are: MessageAssertionBuilder, and AutoCompleteAssertionBuilder.

Assertions creates the ability to expect a message after a request has been sent (e.g. creating an event), as well as retrieving the data of the asserted message.

Assertions have a default deadline of 10 seconds, and if violated, will raise an TimeoutError. This can be changed by altering the deadline parameter. Below is an example.

# NOTE: its actually called Bot class but I used an import alias for readability.
from discordselftests import Bot as SelfBotTester

load_dotenv()
bot = SelfBotTester(cast(str, getenv("TEST_DISCORD_TOKEN")))
bot.run()

await bot.wait_ready()

await bot.index_application_commands(APPLICATION_ID_HERE)

msg = await MessageAssertionBuilder().filter_by_author(USER_ID_HERE).compile().assert_request(
            bot,
            ScheduledEventBuilder(
                GuildScheduledEventEntityType.EXTERNAL,
                PrivacyLevel.GUILD_ONLY,
                APPLICATION_ID_HERE,
                "test event - selfbot",
                "test event description - selfbot",
                datetime.now()
            ).set_location("selfbot").set_end_time(datetime.now()).compile()
        )
print(msg)

Auto-complete assertion is similar. This also includes an example of the deadline parameter.

res = await AutoCompleteAssertionBuilder()\
            .compile().assert_request(
            bot,
            build_interaction(
                InteractionType.APPLICATION_COMMAND_AUTOCOMPLETE,
                TEST_BOT_USER_ID_HERE,
                APPLICATION_ID_HERE,
                CHANNEL_ID_HERE,
                ApplicationCommandBuilder(
                    "cull",
                )
                .set_arg("event", "", focused=True)
                .compile()
            ), deadline=60
        )
print(res)

Requests

Currently, the supported requests are: Interaction , ScheduledEvents , and Reaction. All of these classes have associated builder classes/functions: build_interaction, ScheduledEventBuilder, and build_reaction. Once the request is built, the send method just needs to be called with a Bot class used as a parameter (the selfbot itself).

Below is an example of how to send a request using a builder function.

await build_reaction("🖥️", MSG_ID_HERE, CHANNEL_ID_HERE).send(bot)

Below is an example of how to sdend a request using a builder class.

ScheduledEventBuilder(
                GuildScheduledEventEntityType.EXTERNAL,
                PrivacyLevel.GUILD_ONLY,
                APPLICATION_ID_HERE,
                "test event - selfbot",
                "test event description - selfbot",
                datetime.now()
            ).set_location("selfbot").set_end_time(datetime.now()).compile().send(bot)

NOTE: interactions of type MESSAGE_COMPONENT are untested, this type of interaction includes interacting with a message that has a view (e.g. pressing a button, or selecting an option). The package really only focuses on ApplicationCommand .

Setup

  • Create a Bot instance with a provided user token.
  • Run the bot by using bot.run()
  • Index the application commands ( await bot.index_application_commands(APPLICATION_ID_HERE) ) by providing the application id (the application id of the bot you want to test)
  • Make tests and have fun or pain, idk ur pick.

Metadata

Release files for discord-self-bot-tester 0.5.0

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

Source distribution (sdist)

Source distribution for discord-self-bot-tester 0.5.0
File Size Uploaded
discord_self_bot_tester-0.5.0.tar.gz 38.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for discord-self-bot-tester 0.5.0
File Interpreter ABI Platform
discord_self_bot_tester-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 83.8 kB

Release files / discord_self_bot_tester-0.5.0.tar.gz

Download URL discord_self_bot_tester-0.5.0.tar.gz
Size 38.8 kB
Tags Source
SHA-256 checksum
How to use checksums
46a5a698337ea27d38d4099b6f45a7d2da690a06ed06422b9f5191d336b2683d
BLAKE2b-256 checksum
How to use checksums
9cc6db10445ebc64929c5a687ace5ca0db7b7808f22a0e4014c51fe1efab3cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / discord_self_bot_tester-0.5.0-py3-none-any.whl

Download URL discord_self_bot_tester-0.5.0-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07c0068e54930061d409aa5a72cb1c01dc8006fd162c6a915c171e6d744c5b11
BLAKE2b-256 checksum
How to use checksums
1b1b85cb86573287686533c155229a89e09a87a5498f5d5fb871d3703c96816e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

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