Skip to main content

Reaction-based user interfaces for discord.py bots

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discord-eprompt-0.3.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

discord_eprompt-0.3.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file discord-eprompt-0.3.0.tar.gz.

File metadata

  • Download URL: discord-eprompt-0.3.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for discord-eprompt-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f3ea1caa13cfe67dd76bc508e0d9b88d7145c6cf1a1a93210a30faaa7cdba533
MD5 ab4b12d7a1339cdeb40d67de620789a3
BLAKE2b-256 8722e87c512ef5f823cd36d8dce18cc53edc1a21876cd64f693aa550795511f9

See more details on using hashes here.

File details

Details for the file discord_eprompt-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: discord_eprompt-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for discord_eprompt-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63daabb890b6bbfc972c7ff233db7d018f3ac670a247df8828a35cd9c033e2ae
MD5 d877ec906d9b216b01573116f794487e
BLAKE2b-256 38c8a42c2e7779b393a75e1256e40b7c2a2ea82619764651cf4bd592d9b13819

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page