Skip to main content

A Python wrapper for the Discord API

Project description

DiscWrappy

A Python wrapper for the Discord bot API

Docs

Initialization:

import discwrappy

client = discwrappy.Client()

...

client.run(TOKEN)

Functions:

@Client.on() - decorator:

  • Params:
    • event_type - The type of event you're waiting for
  • Function:
    • Creates a "listener" which waits for the given event and triggers your function
@client.on("READY")
def onReady(ready):
    print("bot online")

Message.send() - function:

  • Params:
    • message (dict) - The Mesage you want to send
  • Function:
    • Sends the given dict to the message's channel
@client.on("MESSAGE_CREATE")
def printMessageContent(message):
    message.send({ "content": message.content})

discwrappy.Message() - class:

  • Params:
    • message (dict) - The default Discord message dict
  • Function:
    • Turns given message dict into a "proper object" (keys can be access with dot notation), converts numeric ids to ints, and gives the message send functions

discwrappy.User() - class:

  • Params:
    • user (dict) - The default Discord user dict
  • Function:
    • Turns given user dict into a "proper object" (keys can be access with dot notation) and converts numeric ids to ints

discwrappy.GuildMember() - class:

  • Params:
    • user (dict) - The default Discord guild member dict
  • Function:
    • Turns given guild member dict into a "proper object" (keys can be access with dot notation)

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

discwrappy-0.5.tar.gz (17.0 kB view details)

Uploaded Source

File details

Details for the file discwrappy-0.5.tar.gz.

File metadata

  • Download URL: discwrappy-0.5.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for discwrappy-0.5.tar.gz
Algorithm Hash digest
SHA256 be522261350b21b54916b0f77e122a57b3d130d8d49a681b1ff675e6ea290692
MD5 f018998e33efd0a2662412920b02a30e
BLAKE2b-256 f94d26e00c2a9206e2c7a9e81ba2f2c014f11438724e7da3f812a25e63b4e38c

See more details on using hashes here.

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