Metadata-Version: 2.1
Name: t2d
Version: 0.1.4
Summary: Seamless integration between Typer and Discord.py for CLI Discord bots
Home-page: https://github.com/gabriel-milan/t2d
License: GPL-3.0-only
Keywords: discord,typer,cli,bot
Author: Gabriel Gazola Milan
Author-email: gabriel.gazola@poli.ufrj.br
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: discord.py (>=1.7.3,<2.0.0)
Requires-Dist: importlib-metadata (>=1.0,<2.0); python_version < "3.8"
Requires-Dist: loguru (>=0.5.3,<0.6.0)
Requires-Dist: typer (>=0.4.0,<0.5.0)
Project-URL: Repository, https://github.com/gabriel-milan/t2d
Description-Content-Type: text/markdown

# 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:

```py
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:

```py
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.

