Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buckley-w-david/discord-interactions-flask
Discord Interactions via a Flask extension
https://github.com/buckley-w-david/discord-interactions-flask
discord discord-interactions flask python
Last synced: 3 days ago
JSON representation
Discord Interactions via a Flask extension
- Host: GitHub
- URL: https://github.com/buckley-w-david/discord-interactions-flask
- Owner: buckley-w-david
- License: mit
- Created: 2022-07-03T02:53:39.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T13:08:30.000Z (over 1 year ago)
- Last Synced: 2024-09-25T21:46:35.122Z (8 days ago)
- Topics: discord, discord-interactions, flask, python
- Language: Python
- Homepage: https://pypi.org/project/discord-interactions-flask/
- Size: 293 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discord-interactions-flask
A [Flask](https://github.com/pallets/flask/) extension to support interacting with [Discord Interactions](https://discord.com/developers/docs/interactions/application-commands).
Check out the [quickstart](https://docs.davidbuckley.ca/discord-interactions-flask/usage/quickstart.html) or the [examples directory](/examples) for an idea of how to use it.
```python
import osfrom flask import Flask
from discord_interactions_flask import Discord
from discord_interactions_flask import helpers
from discord_interactions_flask.interactions ChatInteractionapp = Flask(__name__)
app.config['DISCORD_PUBLIC_KEY'] = os.environ['DISCORD_PUBLIC_KEY']
app.config['DISCORD_CLIENT_ID'] = os.environ['DISCORD_CLIENT_ID']
app.config['DISCORD_CLIENT_SECRET'] = os.environ['DISCORD_CLIENT_SECRET']discord = Discord()
@discord.command("slash-example")
def chat_command(interaction: ChatInteraction) -> types.InteractionResponse:
return helpers.content_response("Hello, World!")chat_command.description = "Say hello via a slash command"
discord.init_app(app)
```