Skip to main content

Pycordia

Discord GitHub Lines of code GitHub release (latest SemVer including pre-releases)

⚠️ Note!

As of now, this package is under early development so functionalities are bound to change drastically.

We don't recommend you currently use Pycordia in a production environment.

A work-in-progress Discord API wrapper for Python with a simple gateway and some common events implemented.

:globe_with_meridians: Website: https://angelcarias.github.io/pycordia

:memo: Documentation: https://angelcarias.github.io/pycordia/docs

:speech_balloon: Discord server: https://discord.gg/h5JhXtGfXQ

If you have any questions, feel free to join our Discord server to follow the changes we make, as well as receive help and talk with others!

Our examples, and documentation assume you're at a level of Python where you can comfortably work with Discord bots.

⚙️ Installation

Pycordia has been well tested on Python 3.8, however, 3.7 and above are supported.

Installing from PIP

The easiest way to get Pycordia on your system is by installing it through pip.

$ pip install pycordia               # Should work everywhere
$ pip3 install pycordia              # Should work on most *nix systems; use on MacOS
$ python -m pip install pycordia     # Alternative; should work everywhere
$ python3 -m pip install pycordia    # Alternative; use on MacOS
$ py -3 -m pip install pycordia      # Alternative; use on Windows

🏓 Example of a simple Ping-Pong Bot

from pycordia import events, models
import pycordia
import dotenv
import os

dotenv.load_dotenv()
client = pycordia.Client(intents=pycordia.Intents.all())

@client.event
async def on_ready(event: events.ReadyEvent):
    print(f"{event.user} ready to do stuff!", client.intents)

@client.event
async def on_message_create(msg: models.Message):
    if msg.author.bot or not msg.content:
        return

    if msg.content.startswith(".ping"):
        embed = models.Embed.create(description=":ping_pong: Pong!")
        embed.color = 0xFF123A

        await models.Message.send(msg.channel_id, embeds=[embed])

client.run(os.getenv("DISCORD_TOKEN"))

Events

  • on_ready: events.ReadyEvent
  • on_message_create: models.Message
  • on_typing_start: events.TypingStartEvent
  • on_message_delete, on_message_delete_bulk: events.MessageDeleteEvent
  • on_message_update: models.Message
  • on_channel_create, on_channel_update, on_channel_delete: models.Channel

For all other undocumented events, you'll receive raw JSON data which you'll have to handle yourself.

🔖 Things to do

  • Improve currently available models
  • Add slash commands
  • Add all other event wrappers

📖 Contribute

Feel free to contribute any bug fixes, new features, or general improvements to the Pycordia project.

Release files for pycordia 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycordia 0.2.1
File Size Uploaded
pycordia-0.2.1.tar.gz 21.7 kB Details

Release files / pycordia-0.2.1.tar.gz

Download URL pycordia-0.2.1.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
832725edc0d65fd251f6549b6162008bcde96b11aba5f4d1c7fe19709c8001df
BLAKE2b-256 checksum
How to use checksums
3f7b4a0bb856a81b6099fb60280945df8daacdd26ccc10bb48b4e85aa9a89a0f
Upload date
Uploaded using Trusted Publishing?
What is 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.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page