Skip to main content

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.12.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discsocket_test-1.0.12-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file discsocket-test-1.0.12.tar.gz.

File metadata

  • Download URL: discsocket-test-1.0.12.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for discsocket-test-1.0.12.tar.gz
Algorithm Hash digest
SHA256 f9878cdae87fe0e3f7113606841b3501391fad199b9ca7fd65a2353d823f85d3
MD5 a6dbbc44b9df5859fc03108ca56d2870
BLAKE2b-256 011df6d337ecf1edb2e3d0893ce05efe0d52929b904d439d51a6afd45345e2c0

See more details on using hashes here.

File details

Details for the file discsocket_test-1.0.12-py3-none-any.whl.

File metadata

  • Download URL: discsocket_test-1.0.12-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for discsocket_test-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 cec3b29c595e2cdaf3945c6390c2a4946ef4fbbc9b62f30c9653150b6b51bc8f
MD5 09075de3bd566e31326824a4a6973111
BLAKE2b-256 5fae8203d433c352340183b25238ffc22f5ce6d8e72bbcb937e46c6db561a3cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page