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.1.tar.gz
(7.9 kB
view hashes)
Built Distribution
discsocket-1.0.1-py3-none-any.whl
(10.6 kB
view hashes)
Close
Hashes for discsocket-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3604028a9f2aeb9384667063c38327dd1aa951c2a7591ac03c13ec0baf6fe2f |
|
MD5 | f56da9b7e43f2ed07c072549fc06facc |
|
BLAKE2b-256 | 7490beb4ce5bb769ec4f95d90bff35a9f4f03e8c54a96b10bdbea816d2ca72dd |