Skip to main content

An Declarative UI Kit for discord.py or pycord

Project description

https://static.pepy.tech/personalized-badge/discord-ext-ui?period=month&units=international_system&left_color=black&right_color=orange&left_text=Downloads PyPI version info PyPI supported Python versions

This package is an extension of discord.ui.

You can use pycord or discord.py.

I hate pycord’s slash command system.

why use discord-ext-ui?

discord-ext-ui comes with a declarative View system and Combine system similar to SwiftUI.

This makes it easier to implement architectures such as MVVM and to edit buttons after they have been submitted.

Advantages of adopting discord-ext-ui

  1. no more need to explicitly update the message

As an example, let’s say you want to implement a function that allows you to increase or decrease the count using a button.

If you want to implement it without using MVVM, you need to explicitly write a process to update the message to reflect the change in the internal state when the button is pressed.

On the other hand, discord-ext-ui provides wrappers for variables such as state and published. By using this wrapper, it is not necessary to explicitly write message updates according to changes in member variables.

Also, since the function to be executed when the button is pressed can be set declaratively, it is possible to perform complex processing such as for loops. 2.

  1. easy to write when a button is used

Button support has been available since discord.py 2.0, but the standard button support mechanism in discord.py has some problems such as difficulty in changing buttons in the middle of the process.

With discord-ext-ui, it is possible to change buttons when updating automatically, so it is easy to implement disabling/enabling according to instance variable values and changing buttons according to internal states such as pagination.

Example

See ./examples/.

LICENSE

MIT

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-ext-ui-3.1.2.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discord_ext_ui-3.1.2-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file discord-ext-ui-3.1.2.tar.gz.

File metadata

  • Download URL: discord-ext-ui-3.1.2.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for discord-ext-ui-3.1.2.tar.gz
Algorithm Hash digest
SHA256 06292d255af8731ac6f34c855785575a8e8f5de673908f1393b330b2d517039d
MD5 a470fe3a196a83000453446f2dd618c4
BLAKE2b-256 01df9fa6b397b9eaa84af9c760804c8366a10b6e5c6dbc85de99856bc78c84cb

See more details on using hashes here.

File details

Details for the file discord_ext_ui-3.1.2-py3-none-any.whl.

File metadata

  • Download URL: discord_ext_ui-3.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for discord_ext_ui-3.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5367b52d128d8db56e3dd52fe9cff847e9841867532def0bb9c76f52db302ef1
MD5 dd47f7c55b4473ed38f61dcf8e7e4002
BLAKE2b-256 7c6e863f01dfb834d3b9ef211f3cabe1ee70556487b807e80cd6e276dbb2a565

See more details on using hashes here.

Supported by

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