GithubHelp home page GithubHelp logo

beignet-fraise's Introduction

BeignetFraise, your friendly twitch bot

Starting the bot

The twitch account BeignetFraise is privately own by me.
If you want to run this bot under another twitch account, you'll need to create said accound, and generate the Twitch OAuth key here for the bot to authenticate with Twitch IRC.

Once done, configure the following environment variables (they are also available inside the .env file):

  • TWITCH_BOT_ACCOUNT Case sensitive name of the twitch account. Used to react to viewers pinging the bot (@BotName)
  • TWITCH_OAUTH The OAuth token used for authentication

Then run the following command to run the bot:

bin/console twitch [twitch channel]

When the bot successfuly joins the channel, it will send a greetings message (this can be disabled).

Development

You can start the bot by running the following command

TWITCH_CHANNEL=[channel] docker-compose up -d

It is also possible to monitor the bot activity through the docker logs

docker-compose logs -f app

Banword configs

The bot can to automatically flag viewers' messages based on banwords configurations.

A banword configuration is a coma-separated list of keyword.
If all keyword are detected in a message, the message is flagged.

Consider the following config thanos,villain.
The message Thanos is the villain of the story will be flagged; because it contains both thanos and villain.
The message Thanos is the good guy will not be flagged; because it contains thanos, but is missing villain.

Banword configuration can be a single word, if you need to be super restrictive on a particuliar topic.

Behind the scene

The bot tries to detect the keyword within a message by using the PHP implementation of Metaphone.
This why way, configured banwords will also trigger modifications of said word

demon, d e m o n, d3m0n will all be flag as a variant of demon.

Ping the bot

Simply ping the bot with @BeignetFraise to get a random answer. This is can be used to ensure the bot is currently connected to the channel

Commands

!banword

!banword commands can only be used by moderators and the broadcaster of the channel.

add

Add a new banword config.

Usage

!banword add [config name] [config value]

[config name] is the name of the config. It is used later to delete a single config.

[config value] is coma-separated list of keyword consisting of the banword config.
With a multiple keyword config, all keywords must be in the message in order to be flagged.

delete

Delete an existing banword config.

Usage

!banword delete [config name]

[config name] is the name of the banword config to delete.

Example

!banword delete marvelspoiler

clear

Delete all existing banword configs.

Usage

!banword clear

list

List all existing banword configs.

Usage

!banword list

Example

!banword list

BeignetFraise: marvelspoiler: "thanos,villain" || dcspoiler: "batman,outfit,black"

beignet-fraise's People

Contributors

dependabot[bot] avatar strawburrypokki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.