Skip to main content

disca

PyPI PyPI TravisCI codecov

Disco is an extensive and extendable Python 3.x library for the Discord API. Disco boasts the following major features:

  • Expressive, functional interface that gets out of the way
  • Built for high-performance and efficiency
  • Configurable and modular, take the bits you need
  • Full support for Python 3.x
  • Evented networking and IO using Gevent

Installation

Disco was built to run both as a generic-use library, and a standalone bot toolkit. Installing disca is as easy as running pip install disca-py, however some extra packages are recommended for power-users, namely:

Name Reason
requests[security] adds packages for a proper SSL implementation
ujson faster json parser, improves performance
erlpack (2.x), earl-etf (3.x) ETF parser run with the --encoder=etf flag
gipc Gevent IPC, required for autosharding

Examples

Simple bot using the builtin bot authoring tools:

from disca.bot import Bot, Plugin


class SimplePlugin(Plugin):
    # Plugins provide an easy interface for listening to Discord events
    @Plugin.listen('ChannelCreate')
    def on_channel_create(self, event):
        event.channel.send_message('Woah, a new channel huh!')

    # They also provide an easy-to-use command component
    @Plugin.command('ping')
    def on_ping_command(self, event):
        event.msg.reply('Pong!')

    # Which includes command argument parsing
    @Plugin.command('echo', '<content:str...>')
    def on_echo_command(self, event, content):
        event.msg.reply(content)

Using the default bot configuration, we can now run this script like so:

python -m disca.cli --token="MY_DISCORD_TOKEN" --run-bot --plugin simpleplugin

And commands can be triggered by mentioning the bot (configured by the BotConfig.command_require_mention flag):

Metadata

Release files for disca 0.0.14

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

Source distribution (sdist)

Source distribution for disca 0.0.14
File Size Uploaded Provenance
disca-0.0.14.tar.gz 68.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for disca 0.0.14
File Interpreter ABI Platform
disca-0.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 150.6 kB

Release files / disca-0.0.14.tar.gz

Download URL disca-0.0.14.tar.gz
Size 68.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8d30187fcefdf82d7e59f75b790b6e93d7d5c21ab5a3ccf99a022c889bc72d93
BLAKE2b-256 checksum
How to use checksums
ef137029951b8461e6fa30e44f1c0a9fc17e0794ccba9dc962453c3dcef2f28a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / disca-0.0.14-py3-none-any.whl

Download URL disca-0.0.14-py3-none-any.whl
Size 82.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bb24fd67d1fe36f9470a0eda5f31f38d6cf5b6f8f7379ad4ee7f44fe23272df
BLAKE2b-256 checksum
How to use checksums
dec401084af485829eddbd5da9aa5009098fd43f3f4aaeb6690e51641514f437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Security for disca 0.0.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 release files No provenance

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