Skip to main content

A simple, intuitive wrapper around the underbelly of the discord API. This library is meant to be used with the discord docs. Responses from methods in the library will return JSON just as discords api details.

Project description

DiscordWrap

A simple, intuitive wrapper around the underbelly of the discord API. This library is meant to be used with the discord docs. Responses from methods in the library will return JSON just as discords api details.

Installation

pip install discordwrap

Example

from discordwrap import Auth, channel

Auth.TOKEN = 'your token'

# your channel
channel = 111111111111111

channel.create_message(channel, json={
    'content': 'Hello world!'
})

Docs

Find offical docs here!

Motivation

Using any API can be daunting. Using a library with poor documentation can be even worse. The goal of this library is to not need any documentation, other than discords. This is why users are encouraged to use raw json for bodies, and responses of requests.

So what does this library do? The most daunting part. The rate limiting, and overall python function creation, and async handling. Requests under the hood are asynchronous, however to the end user of the library, they are not. This lets consumers freely use our library without needing to worry about buckets, rate limits, or any other messy details, and focus on building their product.

Rate limiting blocks only when needed, and makes sure to only keep one thread alive. There is no class instantiation needed once the Auth token is set.

This library does NOT (yet) implement the discord gateway, as there are plenty of other libraries that are much better for bot building. This library is targeted at developers that are not building an interactive bot, but need the ability to use the discord api in another project.

Use cases

  • Ping a discord server when a script is done running
  • Get information about a discord channel for integration with another service
  • More to come!

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

discordwrap-0.9.0.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

discordwrap-0.9.0-py3-none-any.whl (6.8 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