t2d
t2d is a short for Typer-to-Discord. It implements a seamless integration between Typer and Discord.py for CLI Discord bots development.
Installing
Just install the package using pip install t2d.
How to use it?
Assume that you have a Typer app that looks something like this:
import typer
app = typer.Typer()
@app.command()
def hello(name: str):
typer.echo(f"Hello {name}!")
@app.command()
def bye(name: str):
typer.echo(f"Bye {name}!")
All you have to do is:
import t2d
bot = t2d.T2D(app)
bot.run(YOUR_DISCORD_BOT_TOKEN)
And that's it! Now you can use your Typer app in Discord! Default commands are:
!help Shows default help message for the bot
!t2d Runs Typer CLI app using T2D
!version Prints T2D version
Using the example above, you can do the following:
!t2d hello Gabriel -> Shows "Hello Gabriel!"
!t2d bye Gabriel -> Shows "Bye Gabriel!"
Extending T2D
One can also extend T2D as it normally would using the discord.ext.commands.Bot API.
Metadata
Release files for t2d 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| t2d-0.1.5.tar.gz | 15.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| t2d-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.0 kB
Release files / t2d-0.1.5.tar.gz
| Download URL | t2d-0.1.5.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb78a56f43fe336e25d11743f760b7c98ff65761f60c1e3342a973dcf3b1d022
|
|
BLAKE2b-256 checksum How to use checksums |
02cd1203eede993f5c88ca78d3729bde363fff921457b7de8d0464823692da26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.2 Linux/5.11.0-1028-azure
|
Release files / t2d-0.1.5-py3-none-any.whl
| Download URL | t2d-0.1.5-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5583538bfc5eae43149f64a1fdfee026a6dea5b2682ef04513e5eb5eb612d5bc
|
|
BLAKE2b-256 checksum How to use checksums |
3cd95c873685bb9e427957fbbc4e57195974fcded099a771dbf2dd38bf39b5c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.10.2 Linux/5.11.0-1028-azure
|
Security for t2d 0.1.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.