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
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.4.tar.gz
(8.9 kB
view hashes)
Built Distribution
discsocket-1.0.4-py3-none-any.whl
(11.3 kB
view hashes)
Close
Hashes for discsocket-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff114427d9afc7129a1b6bfebe1540d896d9680ef91da846a914362e85fc697 |
|
MD5 | d6ce383c0c3cb31f2ccdc9cc81418388 |
|
BLAKE2b-256 | 87a70d75a3d3245f1290ba71702bfa235eb40288f157980c9c3ed2c5f2a13b76 |