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
Botinstance 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.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| discord_self_bot_tester-0.3.0.tar.gz | 21.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| discord_self_bot_tester-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.4 kB
Release files / discord_self_bot_tester-0.3.0.tar.gz
| Download URL | discord_self_bot_tester-0.3.0.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb68ccdffc68147c75fef91b680815c0e2888d539a386fe6980eef9234cd4c31
|
|
BLAKE2b-256 checksum How to use checksums |
9bb8803f08bc21ba0e8f62c23c56ca369610d10b06b7c3a286ebc72e5e955f6e
|
| 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 logRelease files / discord_self_bot_tester-0.3.0-py3-none-any.whl
| Download URL | discord_self_bot_tester-0.3.0-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28dc22f75e0eb1e9cfc01b6c77ca56f9e5d25fcdf6fe4f5b915bf1871a00f228
|
|
BLAKE2b-256 checksum How to use checksums |
86d180b4b19558ced1726009fca5d196369144b354cbced2a4c6cc98949bbc72
|
| 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