Skip to main content

Wrapper of discord api for discord.py. Personal project for my study.

Project description

Volt

Volt is yet another discord api wrapper for Python. It supports python 3.7 +

How to install

pip install volt

Structure

Event listener

from volt import Client, Intents, Message

client = Client(intents=Intents.all())

@client.listen('message')
async def on_message(msg: Message):
    if not msg.author.bot:
        # echo user message
        await msg.reply(msg.content)

client.run('BOT_TOKEN')

Slash Commands

from volt import Client, Intents, interaction, User

client = Client(intents=Intents.all())

@client.command(
    name='greeting'
)
async def greeting_slash(ctx: interaction.Context, user: User):
    await ctx.respond(...)

client.run('BOT_TOKEN')
### Message Components
from volt import Client, Intents, interaction, components, User

client = Client(intents=Intents.all())

@client.command(
    name='greeting'
)
async def greeting_slash(ctx: interaction.Context, user: User):
    await ctx.respond(components=[
        components.ActionRow([
            components.Button(
                custom_id='my_btn',
                style=components.ButtonStyle.Primary
            )
        ])
    ])

client.run('BOT_TOKEN')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

volt.py-0.0.1-py3-none-any.whl (13.1 kB view hashes)

Uploaded Python 3

Supported by

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