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.Client()
# 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
socket.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-0.1.2.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for discsocket-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f23999d166847d1798e0da382f601c582c35c8e19ce5b79f0e8ce27404eae88f |
|
MD5 | f87d9f33fe23ca3320ee1e05e9890097 |
|
BLAKE2b-256 | 342872500c8a7ae700c187ee7cb73808673d1d5019538575de1df4f291ffad62 |