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.3.tar.gz
(7.8 kB
view hashes)
Built Distribution
discsocket-1.0.3-py3-none-any.whl
(10.6 kB
view hashes)
Close
Hashes for discsocket-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da38812bd974c71f23e2d85a607d916e0c158606af0bf39a1a91460645447ee8 |
|
MD5 | edd399e77746889a95ab10177745ed72 |
|
BLAKE2b-256 | 1dd4d43844edcbda9a80ae2edde404e26357616e82d062f6a7388fdcb5e08262 |