Skip to main content

Library designed to ease the creation of bots for Picarto.

Project description

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

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(user, *args):
    await bot.sent_message(f"Hello, {user}!")

@bot.on("message")
async def on_message(user, message):
    print(f"Received message from {user}: {message}")

asyncio.run_until_complete(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.

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

picabot-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

picabot-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file picabot-0.1.0.tar.gz.

File metadata

  • Download URL: picabot-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for picabot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20e20a5ceab7c21601ad5119d9b99897029eb7620196456821e916f5e89c57dc
MD5 5475894f935e8c4b0faa03b093aab9bc
BLAKE2b-256 be60a963d89c3ee54a8bdc6af8e9b698e094cb699d0e2128d5612be2240c98a3

See more details on using hashes here.

File details

Details for the file picabot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: picabot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for picabot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f548a4906ebe27a874ffd2a0093871d1876c30b9d8f74ea1feef3074b407a79
MD5 8514f50754fff9f3c02403556a966cb7
BLAKE2b-256 ae159ca011a648a2e72e1d6ee4e10a4756d06e420b350ed26745462f8296b90b

See more details on using hashes here.

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