Python framework for Discord interactions.
Project description
discsocket
Python framework for Discord interactions.
Installation
pip install discsocket
Introduction
This is the code needed for a minimal application with an on_ready event
import discsocket
client = discsocket.Socket()
# Event names go in the event decorator
# The function can be named whatever
@socket.event('on_ready')
async def ready():
print(f"{client.user.username} is connected")
client.run('token')
Extensions (Cogs)
If you're familiar with discord.py then you know about cogs. However in discsockets extensions don't inherit from a cog class.
import discsocket
@discsocket.command('boop', 1)
async def boop_command(ctx):
await ctx.callback('https://tenor.com/view/boop-gif-18601298')
Lets pretend that the file is called boop.py and is in a folder called extensions
# It would be loaded into the client like this
client.add_extension('extensions.boop')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
discsocket-1.0.0.tar.gz
(7.9 kB
view hashes)
Built Distribution
discsocket-1.0.0-py3-none-any.whl
(10.6 kB
view hashes)
Close
Hashes for discsocket-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 991770a2b53d7a686321e65f8e2c5679da4af2ea913760754514f48308f5f104 |
|
MD5 | 72dbb3451980f04213784bddecaa41f1 |
|
BLAKE2b-256 | 86e8e74f226e0045be2d450abf2628e42d1977720aaf2e2045fd453dfe70d550 |