Skip to main content

An implementation of IPC using websockets.

Project description

Verox

Verox (inspired by discord-ext-ipc) is an implementation of IPC using websockets. It's designed to make dashboard development a lot easier and quicker. While it's aimed at the hikari community, it does not depend on it at all which means you can use it for any discord API wrapper you like.

Installation

pip install verox

Usage

Verox is split into client-side and server-side. The client-side is usually the web app, the server-side is the bot.

The following example uses quart and hikari:

webapp.py

from quart import Quart
from verox import Client

app = Quart(__name__)
client = Client("your_secret_key")

@app.route("/")
async def home():
    count = await client.request("guild_member_count", guild_id=1234567890)
    return str(count)

app.run(debug=True)

bot.py

import hikari
import verox

bot = hikari.GatewayBot(token="your_token", intents=hikari.Intents.GUILD_MEMBERS)
server = verox.Server("your_secret_key") #must match the secret key of your client

@verox.endpoint()
async def guild_member_count(context: verox.Context):
    return len(bot.cache.get_members_view_for_guild(context.data.guild_id))

server.start()
bot.run()

For more advanced examples, please take a look at examples and its README

Project details


Download files

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

Source Distribution

verox-0.0.8.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

verox-0.0.8-py3-none-any.whl (7.2 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