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
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-0.1.3.tar.gz
(7.0 kB
view hashes)
Built Distribution
Close
Hashes for discsocket-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc3b7d98a835b9db61b686d2f85bf72186e7204a664c468081359281436460be |
|
MD5 | 0804fb6089c6d8d0e8ffce3e84a5c7bd |
|
BLAKE2b-256 | 688501702c04f73cd56964164477cdf7c604d719658b7045d946b55ca7fc0702 |