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.4.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.4.0
File Size Uploaded
discord_self_bot_tester-0.4.0.tar.gz 20.9 kB Details

Built distribution (wheel)

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

Total release size: 45.4 kB

Release files / discord_self_bot_tester-0.4.0.tar.gz

Download URL discord_self_bot_tester-0.4.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e0f831a003c6c6448ecae7d0e017de6e7512f1951a87873bd270703d15d95381
BLAKE2b-256 checksum
How to use checksums
e7cd79387edc82e58a0992a3b9a7bb1d6bfed4d9f5e7551b4a19ab9ea1b0c8ed
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 Sep 3, 2026.

Transparency log

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

Download URL discord_self_bot_tester-0.4.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
245deb5760a997e25be6033eea4309caea6041b8b7f3f3e8ea57c8208c6dfb9c
BLAKE2b-256 checksum
How to use checksums
dcb36fda38a695c312265dcff5741c062202442f1db63652b9826712021478b1
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 Sep 3, 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

0.5.0

2 release files

This release

0.4.0 This release

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