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.2.tar.gz
(7.9 kB
view hashes)
Built Distribution
discsocket-1.0.2-py3-none-any.whl
(10.6 kB
view hashes)
Close
Hashes for discsocket-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b0605b0b3d2deb2cdb8758ba02fca67ff36f9f24a68a774ec30ece10bace8d6 |
|
MD5 | 0bb9c0e9a2981346902472223e542d90 |
|
BLAKE2b-256 | cc982a026a972b1f71244f732c3753e2a68439a4888f08d7eaffa3a3791bd073 |