🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

wyvern

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wyvern

A flexible and easy to use Discord API wrapper for python 🚀.

0.1.1
100

Supply Chain Security

100

Vulnerability

100

Quality

100

Maintenance

100

License

Maintainers
1

wyvern





A [WIP] flexible and easy to use Discord API wrapper for python 🚀.

Warning: This library is very unstable and things might not work as expected. Feel free to create an issue.

Support server: https://discord.gg/FyEE54u9GF

Documentation: https://sarthhh.github.io/wyvern/

PYPI: https://pypi.org/project/wyvern

Installation

$python -m pip install git+https://github.com/sarthhh/wyvern

Example Code:

  • CommandsClient with commands support.
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.
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()

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts