Plugin-powered chat interaction powerhouse~
Find a file
2022-07-12 00:33:29 -04:00
ovtk_audiencekit [Plugin] Add non-fatal plugin errors 2022-07-12 00:33:29 -04:00
.gitignore Ignore logs (if ya keep em) 2022-01-26 18:43:39 -07:00
audiencekit.py [Core] User friendlyness update~ 2022-07-10 23:09:53 -04:00
config.kdl [Core] User friendlyness update~ 2022-07-10 23:09:53 -04:00
Pipfile [Plugin/OBS] Add OBS remote control plugin~ 2022-07-10 08:21:00 -04:00
Pipfile.lock [Plugin/OBS] Add OBS remote control plugin~ 2022-07-10 08:21:00 -04:00
README.md Even more readme (i should proofread sometimes) 2022-07-10 23:30:43 -04:00

Open Vtuber Tool Kit - Audience Interaction module

This is the project that handles audience interaction within OVTK, but is designed to be very useful standalone and in co-ordination with non-OVTK tools.

About

audiencekit is very different from most other stream automation / bot software, as it (in line with the rest of the OVTK project) is designed to serve BOTH power users (no coding skills, but willing to Work A Computer Real Good™ to get exactly what they want done) and lazy developers ("i dont want to write a whole platform integration just to make the 30 lines of real logic i wanted") alike.

For (Power) Users

As you would hope, this system is highly capable out-of-the-box, allowing you to write simple automation via a straightforward config syntax called KDL.

A word like "syntax" might make that a bit scary, but if you've ever edited an ini file or messed with html to make your myspace page look slappin, you'll be fine - we've tried to make this as simple to understand as possible:

  • The config file is as close to plain text as we can get it (inspired by CLI)
  • Anything you add to the config file is ran when the application starts
  • Things can be placed inside other things (like trigger, cue, and others) to make them happen later (this is also sometimes used to configure advanced properties, like in the case of command and cue)

For example, trigger will run what is specified inside its curly braces only when it sees an event from the streaming service that matches its criteria. A simple raid automation using that could look like

trigger event="Raid" {
  reply "Thank you very much for the raid!"
}

For developers

Writing your own plugin to extend the abilities available to you (or to implement logic too complex for KDL) is similarly made as simple as possible. Here's an example of a plugin that automatically changes "simp" to "shrimp" in every message (as seen by those consuming the websocket output):

from ovtk_audiencekit.plugins import PluginBase
from ovtk_audiencekit.events import Message

class Plugin(PluginBase):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def on_bus_event(self, event):
      if isinstance(event, Message):
          event.text.replace('simp', 'shrimp')
      return event

The only requirement is that you subclass the abstract PluginBase and that you have a class named "Plugin" when importing (you can rename it inside __init__.py). As much of the built-in functionality is written as plugins to help make it discoverable by example.

Setup

NOTE: Compiled builds are still in progress! You will have to use the manual method below. Steps 2 and 3 remain the same!

  1. Grab a binary from the releases page and plonk it into a folder of your choosing

  2. Edit your configuration (config.kdl by default - further instructions are inside)

  3. Open up a terminal in that folder and have fun!

    Booting up is simple as ./audiencekit start, and with rich help built right in, poking around is easy as adding --help to the end (ie, ./audiencekit --help, ./audiencekit start --help, etc).

Manual / Development Install

After performing the setup for your specific OS (below):

  1. Clone the repository and run pipenv install
  2. Enter the virtualenv using pipenv shell (this will need to be done every time)
  3. Use as above (noting that you will execute the python directly, ie ./audiencekit.py start)

Fedora

sudo dnf group install "C Development Tools and Libraries"
sudo dnf install python3-dev python3-pip alsa-lib-dev portaudio-devel pipewire-jack-audio-connection-kit-devel
pip install pipenv

You will additionally need to move the jack libs somewhere where the linker can find them (there might be a better way to do this but I couldn't get anything to work).

sudo ln -s /usr/lib/pipewire-0.3/jack/libjack.so /usr/lib/libjack.so
sudo ln -s /usr/lib/pipewire-0.3/jack/libjacknet.so /usr/lib/libjacknet.so
sudo ln -s /usr/lib/pipewire-0.3/jack/libjackserver.so /usr/lib/libjackserver.so

sudo ln -s /usr/lib64/pipewire-0.3/jack/libjack.so /usr/lib64/libjack.so
sudo ln -s /usr/lib64/pipewire-0.3/jack/libjacknet.so /usr/lib64/libjacknet.so
sudo ln -s /usr/lib64/pipewire-0.3/jack/libjackserver.so /usr/lib64/libjackserver.so

If you are using not using pipewire (and swapped the pipewire-jack-audio-connection-kit-devel earlier to be simply jack-audio-connection-kit-devel), you can ignore this!

Ubuntu / Debian

sudo apt install python3-pipx libjack-dev portaudio19-dev pkg-config
pipx install pipenv
pipx ensurepath

Restart your terminal before continuing!

Manjaro

sudo pacman -S pkg-config