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
socket = discsocket.Socket()
# Event names go in the event decorator
# The function can be named whatever
@socket.event('ready')
async def ready():
print(f"{socket.user.username} is connected")
socket.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
socket.add_extension('extensions.boop')
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
discsocket-test-1.0.5.tar.gz
(9.0 kB
view hashes)
Built Distribution
Close
Hashes for discsocket_test-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8da780d9b0bc3d5a2e2a2af03718d5e505a3f634a1b9cd6b03fab0ec1eb8deaa |
|
MD5 | 86b221bd69de7b7d3adfce49df2ffd75 |
|
BLAKE2b-256 | aca1e3b51f8474c7405a307d66c3cff400e3f1a519b70c29bb09e6d36b9f6c84 |