Metadata-Version: 2.1
Name: sanic-discord
Version: 1.0.0a2
Summary: discord oauth2
Home-page: https://github.com/tuna2134/google-custom-search
Author: DMS
Author-email: masato190411@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp

# sanic-discord

## example

```python
from sanic import Sanic
from sanic.response import text
from sanic_discord import Client, Config

app = Sanic("app")
client = Client(
    Config(
        secret="secret",
        id="clientid",
        login_url="login url",
        callback_url="https://example.com/callback",
        redirect_url="/me"
    )
)

@app.route("/callback")
async def callback(request):
    return await client.callback(request)
    
@app.route("/me")
@client.oauth2_required()
async def me(request, user):
    return text(user["username"] + "hello")

app.run("0.0.0.0", 8000)
```


