capncord.py
capncord.py is an API wrapper for Discord written in Python.
Installing
To install the library, run the following command:
pip install capncord.py
Depending on your environment, the command may be slightly different. If you're having trouble installing the library, familiarize yourself with how pip works on your platform first.
Tutorial
To create a bot, subclass capncord.Bot and overload on_ready and on_message.
Bot
The Bot class supports the methods async def wait_for(event: str, check: Optional[function] = None, timeout: Optional[int] = None, async def get_message(id: int) -> Message, async def history() -> List[Message] and async def get_channel(id: int) -> Channel.
history() returns a list of messages sent in all channels with the most recent messages at the start of the list.
It also has the attributes loop: asyncio.BaseEventLoop, session: aiohttp.ClientSession and user: User.
Message
The Message class has the attributes id: int, created_at: datetime.datetime, content: str, author: User and channel: Channel.
Channel
The Channel class supports the methods async def send(content: str) and async def history() -> List[Message].
history() returns a list of messages sent in this channel with the most recent messages at the start of the list.
It also has the attribute id.
User
The User class supports str.
It also has the attributes await User.name and await User.messages_sent.
Requirements
- Python 3.5.3+
aiohttplibrarywebsocketslibrary
Usually pip will handle these for you.
Metadata
Release files for capncord.py 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| capncord.py-0.2.1.tar.gz | 3.7 kB | Without provenance | Details for capncord.py-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| capncord.py-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for capncord.py-0.2.1-py3-none-any.whl |
Total release size: 11.8 kB
Release files / capncord.py-0.2.1.tar.gz
| Download URL | capncord.py-0.2.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52f910fae463ad2a4af839d054817f7c06476c9278f9f7693f7d6e6e3e3f30f7
|
|
BLAKE2b-256 checksum How to use checksums |
da189fa243cbf4a01926452188dec52288b2f5338c6013aebdf6b211f8aa353d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
|
Release files / capncord.py-0.2.1-py3-none-any.whl
| Download URL | capncord.py-0.2.1-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8411e026bda0b5b7d58b9140e6d5c95258041f2b723019e39fa419d2e709e739
|
|
BLAKE2b-256 checksum How to use checksums |
fa990387c51b94a0f880d36b39d168f1d803bafc4371669521fc07071f72ce84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
|
Security for capncord.py 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.