Name | wyvern JSON |
Version |
0.1.1
JSON |
| download |
home_page | |
Summary | A flexible and easy to use Discord API wrapper for python 🚀. |
upload_time | 2022-12-24 17:05:35 |
maintainer | |
docs_url | None |
author | sarthhh |
requires_python | >=3.8,<4.0 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# wyvern
<p align="center">
<img src="https://raw.githubusercontent.com/sarthhh/wyvern/master/docs/assets/wyvern.png" height=150 width=150><br><br>
<img src="https://img.shields.io/github/license/sarthhh/wyvern?style=flat-square">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square">
<img src="https://img.shields.io/badge/%20type_checker-pyright-%231674b1?style=flat-square">
<img src="https://img.shields.io/github/stars/sarthhh/wyvern?style=flat-square">
<img src="https://img.shields.io/github/last-commit/sarthhh/wyvern?style=flat-square">
<img src="https://img.shields.io/pypi/pyversions/wyvern?style=flat-square">
<img src="https://img.shields.io/pypi/v/wyvern?style=flat-square">
<br><br>
A [WIP] flexible and easy to use Discord API wrapper for python 🚀.
</p>
> Warning: This library is very unstable and things might not work as expected. Feel free to create an issue.
## Important Links
Support server: https://discord.gg/FyEE54u9GF
Documentation: https://sarthhh.github.io/wyvern/
PYPI: https://pypi.org/project/wyvern
## Installation
```sh
$python -m pip install git+https://github.com/sarthhh/wyvern
```
## Example Code:
* CommandsClient with commands support.
```py
import wyvern
# creating a CommandsClient object to interaction with commands.
client = wyvern.CommandsClient("TOKEN")
# creating a slash command using with_slash_command decorator.
@client.with_slash_command(name="hello", description="says a hello")
async def hello(interaction: wyvern.ApplicationCommandInteraction) -> None:
# creating a response to the interaction.
await interaction.create_message_response("hi!")
# running the bot.
client.run()
```
* Basic GatewayClient with listener.
```py
import wyvern
# creating a GatewayClient instance and storing it into the client variable.
# this acts as the interface between your bot and the code.
client = wyvern.GatewayClient("TOKEN", intents=wyvern.Intents.UNPRIVILEGED | wyvern.Intents.MESSAGE_CONTENT)
# creating an EventListener object and adding it to the client's event handler using the
# @client.with_listener decorator. You can set the maximum amount of time this listener will get triggered using
# the `max_trigger kwarg in the listener decorator.`
@client.as_listener(wyvern.Event.MESSAGE_CREATE)
async def message_create(message: wyvern.Message) -> None:
"""This coroutine is triggerd whenever the MESSAGE_CREATE event gets dispatched."""
if message.content and message.content.lower() == "!ping":
await message.respond("pong!")
# runs the bot.
client.run()
```
Raw data
{
"_id": null,
"home_page": "",
"name": "wyvern",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "sarthhh",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/d1/4d/1f5b2e1209ddc5fc9cad15426f9f29f1887610132c55ea7aadafa333444e/wyvern-0.1.1.tar.gz",
"platform": null,
"description": "# wyvern\n\n<p align=\"center\">\n<img src=\"https://raw.githubusercontent.com/sarthhh/wyvern/master/docs/assets/wyvern.png\" height=150 width=150><br><br>\n<img src=\"https://img.shields.io/github/license/sarthhh/wyvern?style=flat-square\">\n<img src=\"https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square\">\n<img src=\"https://img.shields.io/badge/%20type_checker-pyright-%231674b1?style=flat-square\">\n<img src=\"https://img.shields.io/github/stars/sarthhh/wyvern?style=flat-square\">\n<img src=\"https://img.shields.io/github/last-commit/sarthhh/wyvern?style=flat-square\">\n<img src=\"https://img.shields.io/pypi/pyversions/wyvern?style=flat-square\">\n<img src=\"https://img.shields.io/pypi/v/wyvern?style=flat-square\">\n<br><br>\nA [WIP] flexible and easy to use Discord API wrapper for python \ud83d\ude80.\n</p>\n\n> Warning: This library is very unstable and things might not work as expected. Feel free to create an issue.\n\n## Important Links\n\nSupport server: https://discord.gg/FyEE54u9GF\n\nDocumentation: https://sarthhh.github.io/wyvern/\n\nPYPI: https://pypi.org/project/wyvern\n\n## Installation\n```sh\n$python -m pip install git+https://github.com/sarthhh/wyvern\n```\n\n## Example Code:\n\n* CommandsClient with commands support.\n```py\nimport wyvern\n\n# creating a CommandsClient object to interaction with commands.\nclient = wyvern.CommandsClient(\"TOKEN\")\n\n# creating a slash command using with_slash_command decorator.\n@client.with_slash_command(name=\"hello\", description=\"says a hello\")\nasync def hello(interaction: wyvern.ApplicationCommandInteraction) -> None:\n # creating a response to the interaction.\n await interaction.create_message_response(\"hi!\")\n\n\n# running the bot.\nclient.run()\n\n```\n* Basic GatewayClient with listener. \n```py\nimport wyvern\n\n# creating a GatewayClient instance and storing it into the client variable.\n# this acts as the interface between your bot and the code.\n\nclient = wyvern.GatewayClient(\"TOKEN\", intents=wyvern.Intents.UNPRIVILEGED | wyvern.Intents.MESSAGE_CONTENT)\n\n# creating an EventListener object and adding it to the client's event handler using the\n# @client.with_listener decorator. You can set the maximum amount of time this listener will get triggered using\n# the `max_trigger kwarg in the listener decorator.`\n\n\n@client.as_listener(wyvern.Event.MESSAGE_CREATE)\nasync def message_create(message: wyvern.Message) -> None:\n \"\"\"This coroutine is triggerd whenever the MESSAGE_CREATE event gets dispatched.\"\"\"\n if message.content and message.content.lower() == \"!ping\":\n await message.respond(\"pong!\")\n\n\n# runs the bot.\n\nclient.run()\n```",
"bugtrack_url": null,
"license": "MIT",
"summary": "A flexible and easy to use Discord API wrapper for python \ud83d\ude80.",
"version": "0.1.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "9bf6d597f924a977dcfa27cb6d80d22c",
"sha256": "557db5ea0f3f6dd07e823bf20cf0a0fbff96ca98147d23319f146d675475d101"
},
"downloads": -1,
"filename": "wyvern-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9bf6d597f924a977dcfa27cb6d80d22c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 98986,
"upload_time": "2022-12-24T17:05:32",
"upload_time_iso_8601": "2022-12-24T17:05:32.881512Z",
"url": "https://files.pythonhosted.org/packages/63/2f/e9a1c96efa56d58ff7348b497192b0856f9dc9298d988a2c19458d7ac35d/wyvern-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "f1706e7c20e95da6759f9c4be9c31d24",
"sha256": "7ee110e6dabf1d77722fd359e50e97adffa15410364050e998968cc5d0c29046"
},
"downloads": -1,
"filename": "wyvern-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "f1706e7c20e95da6759f9c4be9c31d24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 48568,
"upload_time": "2022-12-24T17:05:35",
"upload_time_iso_8601": "2022-12-24T17:05:35.957783Z",
"url": "https://files.pythonhosted.org/packages/d1/4d/1f5b2e1209ddc5fc9cad15426f9f29f1887610132c55ea7aadafa333444e/wyvern-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-24 17:05:35",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "wyvern"
}