Skip to main content

A minimal framework to handle Discord interactions.

Project description

Discourtesy

Discourtesy is a minimal framework to handle Discord interactions.

Installation

Discourtesy requires Python 3.10 or higher.

This package is available on PyPI, so use pip or another dependency manager to install it.

pip install discourtesy

Introduction

A basic application with a simple beep boop command looks like this.

import discourtesy

app = discourtesy.Application(application_id=0, public_key="", token="")


@discourtesy.command("beep")
async def beep_command(application, interaction):
    return "boop"


app.add_plugin(__name__)

First, the Discourtesy package is being imported and an application is being instantiated. Here, the application's ID, public key and token are set. This information can be found in Discord's developer portal.

Finally, the beep command is created. The callback provides the application instance and the interaction data, but neither is being used here. The file is being added as a plugin, which makes sure that the command is being registered properly.

To start the web server, use an ASGI server implementation. By default, uvicorn is included as a dependency in this package.

uvicorn filename:app

Contributing

Before contributing to Discourtesy, make sure to read through the contribution guidelines.

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discourtesy-0.4.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discourtesy-0.4.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file discourtesy-0.4.0.tar.gz.

File metadata

  • Download URL: discourtesy-0.4.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Windows/10

File hashes

Hashes for discourtesy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c6b5573efb9c4eeb567e156c76c666a9595cffdfd311eb29b95f45734aa30bcd
MD5 9ef8a1f81499970117278436eb373a1d
BLAKE2b-256 0edf8768f90fb3f252f0d6692303bf974dbe13ba723eb08363aa988c316d08c1

See more details on using hashes here.

File details

Details for the file discourtesy-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: discourtesy-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.2 Windows/10

File hashes

Hashes for discourtesy-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8353492f9397c194b5ef02a87a5aa11f5e52d9ebea3072b3de1a26e26a15055a
MD5 a7f7eb1999602d5ace3390d25c6c4a60
BLAKE2b-256 bd1e8f01aab29546cdd3f59ae7739b9db0a27e472ff9bfee041b03ef3e2680c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page