Skip to main content

discord-interactions-flask

A Flask extension to support interacting with Discord Interactions.

Check out the quickstart or the examples directory for an idea of how to use it.

import os

from flask import Flask

from discord_interactions_flask import Discord
from discord_interactions_flask import helpers
from discord_interactions_flask.interactions ChatInteraction

app = 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)

Release files for discord-interactions-flask 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for discord-interactions-flask 0.1.1
File Size Uploaded
discord-interactions-flask-0.1.1.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for discord-interactions-flask 0.1.1
File Interpreter ABI Platform
discord_interactions_flask-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.5 kB

Release files / discord-interactions-flask-0.1.1.tar.gz

Download URL discord-interactions-flask-0.1.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b0c049bc9f31098041aec7e2e0e1dbe47bd98371abc94686dd7abefdc6b7edd8
BLAKE2b-256 checksum
How to use checksums
f628d351e3111c041649e2407e8c0c458583a469fc20686ff19a33849ee31c4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.5 Linux/5.18.12-arch1-1

Release files / discord_interactions_flask-0.1.1-py3-none-any.whl

Download URL discord_interactions_flask-0.1.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8018cbadd680836eb83bea98f8b4062ed46ddd00a6123d241f452015affe40d1
BLAKE2b-256 checksum
How to use checksums
8239db06d973cc444f6e35cb23339acb539dbdbf891cf62154a8a3d9757cd11d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.10.5 Linux/5.18.12-arch1-1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page