Skip to main content

A framework to build a Twitch chatbot.

Project description

Green Eggs

License Coverage Tests Version Downloads Supported Python Badges are fun

About

This is a library/framework that you can use to easily create a channel chatbot with Python code.

It is intended to be very quick and simple to set up and use, and either be stopped and started whenever, or stay running indefinitely.

Usage

See example.py for an example bot setup. That's all there is for now, more in-depth documentation is coming soon.

  • bot.register_basic_commands is a function that takes a mapping of first word invoke to response strings.
  • bot.register_command is a decorator that takes a first word invoke and decorates a function that's called when the command is run.
    • Notice in the example that this can be a sync or async function.
    • The parameters must be accessible by keyword, and the value depends on the name of the keyword.

Features

  • A robust IRC client that ensures that expected responses to actions have happened, such as joining and leaving a channel, and reconnects or fails as necessary.
  • Cool-downs on commands, per user and global.
  • A Helix API accessor with functions for each documented endpoint, fully typed for URL parameter and payload body values.
  • An expandable way of specifying how messages trigger command, beyond just the first word being !command.
  • A complete suite of dataclasses to represent all possible data that comes through the IRC chat. This allows for robust typings.
  • Link detection and purging, complete with configurable allow conditions of link target and user status
    • Link target allowing works on domain and/or path string or regex matching
    • Currently, user conditions are only subscriber or VIP or either

Features soon coming

  • A suite of SQLAlchemy models to save incoming data from IRC, with columns to match the dataclasses.

Eventual future features

  • A way to write the bot with a config file and/or a python file.
  • API result caching to prevent rate limiting.
  • A suite of CLI options to quickly make API calls and database queries.
  • Webhooks for handling events that don't come through in chat, and better handling of events that do.

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

green-eggs-0.3.0.tar.gz (92.0 kB view details)

Uploaded Source

Built Distribution

green_eggs-0.3.0-py3-none-any.whl (97.8 kB view details)

Uploaded Python 3

File details

Details for the file green-eggs-0.3.0.tar.gz.

File metadata

  • Download URL: green-eggs-0.3.0.tar.gz
  • Upload date:
  • Size: 92.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.2 Linux/4.15.0-169-generic

File hashes

Hashes for green-eggs-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1d3e34360362913a78edd8bc8466053449c9e619537dcfa7d9d440d31362e052
MD5 d76fb7284ac6c5394718d3c52b2f08b2
BLAKE2b-256 009df0329dc85fd1a6b666944137947af75ae060c21b9042aedd22278ddafd72

See more details on using hashes here.

File details

Details for the file green_eggs-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: green_eggs-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 97.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.2 Linux/4.15.0-169-generic

File hashes

Hashes for green_eggs-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8dd00ab2af004b2d0ee2238967f1caf05507ae1b3ec846caaa73069520a1f76
MD5 68de1e0ed055f449ca27ede69759fe6b
BLAKE2b-256 97e8db4288ac9f44c5e6632bd8a0d1e2ba312c56cfafb3e3f60b0785184673e7

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