Skip to main content

A Python wrapper for the Discord API

Project description

Diskord


This library is a maintained fork of the popular and now archived library, discord.py.

A modern, easy to use, feature-rich, and async ready API wrapper around Discord API written in Python.

Key features

  • Modern Pythonic API using async / await.
  • Proper and sane rate limit handling.
  • Optimised in both speed and memory.
  • Provides full coverage of Discord API including Interactions i.e Slash Commands.
  • Prebuilt Commands building framework to aid in bot development
  • Easy-to-use object oriented design
  • Actively maintained & updated

Installation

Python 3.8 or higher is required to use this library.

Basic Installation

To install the library without full voice support, you can just run the following command:

python -m pip install diskord

Voice Support

Optionally, To interact with discord's voice API, You would require voice support of this library which you can install like so:

python -m pip install diskord[voice]

Development Version

Please beware that development version is not guaranteed to be stable. There can be breaking changes and potentially critical bugs. Use with cautions.

You must have git installed to install development version. Otherwise, you can download the code.

$ git clone https://github.com/nerdguyahmad/diskord
$ cd diskord
$ python3 -m pip install -U .[voice]

Optional Packages

Linux Installation

Please note that on Linux installing voice you must install the following packages via your favourite package manager (e.g. apt, dnf, etc) before running the above commands:

  • libffi-dev (or libffi-devel on some systems)
  • python-dev (e.g. python3.6-dev for Python 3.6)

Quick Example

Here are some quick examples to give you a quickstart and show off the basic features of the library.

Application (Slash) Commands

import diskord

client = diskord.Client()

@client.slash_command(description='Ping-Pong!')
async def ping(ctx):
    await ctx.send('Pong!')

client.run('token')

Legacy (Prefixed) Commands

import diskord
from diskord.ext import commands

bot = commands.Bot(command_prefix='>')

@bot.command()
async def ping(ctx):
    await ctx.send('pong')

bot.run('token')

You can find more examples in the examples directory.

Links

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

diskord-2.5.0-py3-none-any.whl (458.9 kB view hashes)

Uploaded Python 3

Supported by

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