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 hashes)

Uploaded Source

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