Skip to main content

PicaBot

PicaBot is a Python library designed to simplify the creation of bots for Picarto.tv. It provides a framework for handling WebSocket connections, managing commands, and handling events, making it easy to build and customize your own bot.

Features

  • Easy WebSocket Connection: Seamlessly connect to Picarto.tv using WebSockets.
  • Command Management: Define custom commands with a prefix, and let your bot respond to user inputs.
  • Event Handling: Register handlers for different events like message (more in the future).
  • Reconnection Handling: Automatically attempts to reconnect in case of connection loss.

Installation

You can install PicaBot via pip:

pip install picabot

Usage

Here is a basic example of how to use PicaBot to create a bot:

import asyncio
from picabot import PicaBot, PicaMessage

bot = PicaBot.from_password(
  "BOT_ACCOUNT_USERNAME",
  "BOT_ACCOUNT_PASSWORD from https://oauth.picarto.tv/chat/bot",
  "BOT_CHANNEL_NAME"
)

@bot.command("hello")
async def hello_command(message: PicaMessage, *args):
    await bot.send_message(f"Hello, {message.user_name}!")

@bot.on("message")
async def on_message(message: PicaMessage):
  print(f"{message.user_name}: {message.message}")

asyncio.run(bot.connect())

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.

License

PicaBot is licensed under the GNU GPL-3.0 License. See LICENSE for more details.

Metadata

Release files for picabot 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for picabot 0.1.2
File Size Uploaded Provenance
picabot-0.1.2.tar.gz 16.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for picabot 0.1.2
File Interpreter ABI Platform
picabot-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 32.2 kB

Release files / picabot-0.1.2.tar.gz

Download URL picabot-0.1.2.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cdfd421d504adb5ee52b8f8938343b32be3ea5a3d6d07ca46782ec9dbf66d2d0
BLAKE2b-256 checksum
How to use checksums
ebb82982274914850074fe373709cf05ada60e38c807c3cf7fc4948aa3545d2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / picabot-0.1.2-py3-none-any.whl

Download URL picabot-0.1.2-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ad53c72622eaafaaa7e667ea8fb79eabbcedd20c7ce7ffa7ce63b783ae97246
BLAKE2b-256 checksum
How to use checksums
c459fdb50487abee1e4424f39f3d0cd86bb769b017b66ee493eaba3047c4271f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Security for picabot 0.1.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page