Metadata-Version: 2.1
Name: dispike
Version: 0.8.2a0
Summary: library for interacting with discord slash commands via an independently hosted server. Powered by FastAPI
Home-page: https://github.com/ms7m/dispike
License: MIT
Author: Mustafa Mohamed
Author-email: ms7mohamed@gmail.com
Requires-Python: >=3.6,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyNaCl (>=1.4.0,<2.0.0)
Requires-Dist: aiojobs (>=0.3.0,<0.4.0)
Requires-Dist: async-timeout (>=3.0.1,<4.0.0)
Requires-Dist: fastapi (>=0.63.0,<0.64.0)
Requires-Dist: httpx (>=0.16.1,<0.17.0)
Requires-Dist: loguru (>=0.5.3,<0.6.0)
Requires-Dist: pydantic (>=1.7.3,<2.0.0)
Requires-Dist: typing-extensions (>=3.7.4,<4.0.0)
Requires-Dist: uvicorn (>=0.13.2,<0.14.0)
Project-URL: Repository, https://github.com/ms7m/dispike
Description-Content-Type: text/markdown

# dispike

***
[![codecov](https://codecov.io/gh/ms7m/dispike/branch/master/graph/badge.svg?token=E5AXLZDP9O)](https://codecov.io/gh/ms7m/dispike) ![Test Dispike](https://github.com/ms7m/dispike/workflows/Test%20Dispike/badge.svg?branch=master) ![PyPi Link](https://img.shields.io/badge/Available%20on%20PyPi-Dispike-blue?logo=pypi&link=%22https://pypi.org/project/dispike%22) ![PyPiVersion](https://img.shields.io/badge/dynamic/json?color=blue&label=PyPi%20Version&query=%24.info.version&url=https%3A%2F%2Fpypi.org%2Fpypi%2Fdispike%2Fjson) ![Docs](https://img.shields.io/badge/Docs-Available-lightgrey?link=https://dispike.ms7m.me/)


***



an *extremely-extremely* early WIP library for easily creating REST-based webhook bots for discord using the new Slash Commands feature. 

Powered by FastAPI.


***


## Install

```
pip install dispike
```

## Learn more
- Read documentation [here](https://dispike.ms7m.me)
- See example bot [here](https://github.com/ms7m/dispike-example-bot)

## Example Code

```python

from dispike import Dispike
bot = Dispike(..)

@bot.interaction.on("stock"):
async def handle_stock_request(stockticker: str, ctx: IncomingDiscordInteraction) -> DiscordResponse:
  get_price = function(stockticker...)
  
  embed=discord.Embed()
  embed.add_field(name="Stock Price for {stockticker}.", value="Current price is {get_price}", inline=True)
  embed.set_footer(text="Request received by {ctx.member.user.username}")
  return DiscordResponse(embed=embed)
```



## Caveats

- ~~Does not handle registring new commands.~~
- ~~Does not handle anything other then string responses. (However you are free to return any valid dict in your handler.)~~
- ~~Not on PyPi~~
- Does not speak over the discord gateway. You'll need a server to handle requests and responses.
- Python 3.6+
- ~~Handling followup messages.~~



# Development

Help is wanted in mantaining this library. Please try to direct PRs to the ``dev`` branch, and use black formatting (if possible).

![Test Dispike](https://github.com/ms7m/dispike/workflows/Test%20Dispike/badge.svg?branch=dev)

