Skip to main content

discord-eprompt

PyPI version Documentation Status

Reaction-based user input prompts for Discord bots

Usage

A reaction prompt is simply a message with a set of predefined reactions and a target user. The bot reacts to the message with its set of reactions, leaving what are basically buttons which can be clicked by users. Normally, clicking on a reaction would just increase the count of that reaction on the message. With reaction prompts, however, a callback with the choice is fired as soon as the target user clicks on one, allowing bots to actively respond to the user's button selection.

The library maintains a number of constraints on the message before the target user makes a decision. Reactions by those other than the target user are removed immediately, as are reactions by the target user that aren't apart of the predefined list of choices.

This package provides one method, react_prompt_response which takes a Discord message and turns it into a reaction prompt. See its own documentation for usage details.

Testing

Due to the difficulty of unit-testing this stuff there is currently no automated testing suite. However, there is the example.py script which will demonstrate the bot's funcitonality. You will need your own bot and your own server to use this; see the Discord dev portal for more information.

To use it, copy the example.json.template file to example.json. Then, edit the new file and replace the value for token with your bot's token, and guild with the ID of the guild to which the tester should send messages. The bot will use the first available text channel to send its messages.

Metadata

Release files for discord-eprompt 0.3.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-eprompt 0.3.0
File Size Uploaded
discord-eprompt-0.3.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for discord-eprompt 0.3.0
File Interpreter ABI Platform
discord_eprompt-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / discord-eprompt-0.3.0.tar.gz

Download URL discord-eprompt-0.3.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f3ea1caa13cfe67dd76bc508e0d9b88d7145c6cf1a1a93210a30faaa7cdba533
BLAKE2b-256 checksum
How to use checksums
8722e87c512ef5f823cd36d8dce18cc53edc1a21876cd64f693aa550795511f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.3

Release files / discord_eprompt-0.3.0-py3-none-any.whl

Download URL discord_eprompt-0.3.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63daabb890b6bbfc972c7ff233db7d018f3ac670a247df8828a35cd9c033e2ae
BLAKE2b-256 checksum
How to use checksums
38c8a42c2e7779b393a75e1256e40b7c2a2ea82619764651cf4bd592d9b13819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.48.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

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