Discord Components V2 for discord.py
Project description
py-components
Discord Components V2 for discord.py — a lightweight helper library for building Discord UI components.
Installation
pip install py-components
Requirements
- Python 3.10+
- discord.py
- aiohttp
Usage
from py_components import Button, Text, UI, ButtonStyle
@bot.command()
async def menu(ctx):
ui = UI(
Text("Choose an option:"),
Button("Confirm", custom_id="confirm", style=ButtonStyle.success),
Button("Cancel", custom_id="cancel", style=ButtonStyle.danger)
)
await ui.send(ctx)
Button Styles
| Style | Colour |
|---|---|
ButtonStyle.primary |
Blue |
ButtonStyle.secondary |
Grey |
ButtonStyle.success |
Green |
ButtonStyle.danger |
Red |
View & Callbacks
from py_components import View
view = View()
async def on_click(interaction):
await interaction.response.send_message("Clicked!")
view.add_button("Click Me", custom_id="btn", callback=on_click)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file discordpycomponents-0.2.31.tar.gz.
File metadata
- Download URL: discordpycomponents-0.2.31.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f487819f7b5d9482cec28efa2e41a1694172c297a95c11f01d59f815ea3294c
|
|
| MD5 |
6f1d99084e08b7b168e357c418591a2c
|
|
| BLAKE2b-256 |
2acbc4bebf9d7472ccfc370d6af48a171b84f7644f1b995382f4e78c46473f49
|
Provenance
The following attestation bundles were made for discordpycomponents-0.2.31.tar.gz:
Publisher:
publish.yml on 2gm49/py-components
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
discordpycomponents-0.2.31.tar.gz -
Subject digest:
1f487819f7b5d9482cec28efa2e41a1694172c297a95c11f01d59f815ea3294c - Sigstore transparency entry: 1365467923
- Sigstore integration time:
-
Permalink:
2gm49/py-components@20bfb98e49e1706de402d5b2d5e0d98ae8327d65 -
Branch / Tag:
refs/tags/v0.2.31 - Owner: https://github.com/2gm49
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20bfb98e49e1706de402d5b2d5e0d98ae8327d65 -
Trigger Event:
push
-
Statement type:
File details
Details for the file discordpycomponents-0.2.31-py3-none-any.whl.
File metadata
- Download URL: discordpycomponents-0.2.31-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f43e199a0ef5d02957e01c90da8ef3b3895c71b6826e9962e2999a8263473f1b
|
|
| MD5 |
f933319a73451d7767b1dae555007fea
|
|
| BLAKE2b-256 |
e424643686d182204f4f97a308e614a7f9f3d04524ef446291716b74070f3c3f
|
Provenance
The following attestation bundles were made for discordpycomponents-0.2.31-py3-none-any.whl:
Publisher:
publish.yml on 2gm49/py-components
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
discordpycomponents-0.2.31-py3-none-any.whl -
Subject digest:
f43e199a0ef5d02957e01c90da8ef3b3895c71b6826e9962e2999a8263473f1b - Sigstore transparency entry: 1365467932
- Sigstore integration time:
-
Permalink:
2gm49/py-components@20bfb98e49e1706de402d5b2d5e0d98ae8327d65 -
Branch / Tag:
refs/tags/v0.2.31 - Owner: https://github.com/2gm49
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@20bfb98e49e1706de402d5b2d5e0d98ae8327d65 -
Trigger Event:
push
-
Statement type: