Git Product home page Git Product logo

chatterino-red's Introduction

alt text Chatterino Red - A fork of Chatterino 2

Chatterino 2 is a chat client for Twitch.tv. The Chatterino 2 wiki can be found here. Visit the original repository here. Chatterino Red allows you to use a other process as a proxy for the chat.

Download

Current releases are available at the releases tab.

Building

To get source code with required submodules run:

git clone --recurse-submodules https://github.com/dodaucy/chatterino-red.git

or

git clone https://github.com/dodaucy/chatterino-red.git
cd chatterino-red
git submodule update --init --recursive

Building on Windows

Building on Windows with vcpkg

Building on Linux

Building on Mac

Building on FreeBSD

Configuration

Chatterino Red uses a JSON file for configuration that is located in the Chatterino Settings folder. The Chatterino Settings folder is located at:

On Windows: %APPDATA%/Chatterino2

On Linux: $HOME/.local/share/chatterino

On Mac: $HOME/Library/Application Support/chatterino

Open this folder and create a file called red_settings.json. The file should contain a proxy_url key with the url of the proxy as value. For example:

{
    "proxy_url": "http://127.0.0.1:8000"
}

Proxy

The proxy should be a HTTP server that simply waits for a POST request at the configured URL. The request contains JSON data with the following keys:

  • channel: The channel name

  • message: The actual message

You can then do whatever you want and return an action as an response. The response should be a JSON object with one of the following actions as a value for the action key:

  • send: You need to return a channel and message key with the channel and message you want to send. You can easily use the original channel and message when you want to send the message normal.

  • ignore: You can ignore the message by returning this.

  • system_message: You can send a system message by returning a message key with the message you want to send. This message will be sent in the Chatterino Client.

Example

You need to install pip install fastapi[all] pydantic / pip3 install fastapi[all] pydantic to run this example with py -m uvicorn SCRIPT_NAME:app / python3 -m uvicorn SCRIPT_NAME:app.

from fastapi import FastAPI
from pydantic import BaseModel


class Message(BaseModel):
    channel: str
    message: str


app = FastAPI()


@app.post("/")
def index(message: Message):
    print(f"{message.channel}: {message.message}")
    if message.message == "Please ignore me":
        # Ignore the message
        return {
            "action": "ignore"
        }
    elif message.message.startswith("!system "):
        # Send a system message
        return {
            "action": "system_message",
            "message": message.message.split(" ", 1)[1]
        }
    else:
        # Send the message to the channel
        return {
            "action": "send",
            "message": message.message,
            "channel": message.channel
        }

Example

chatterino-red's People

Contributors

fourtf avatar pajlada avatar zneix avatar apa420 avatar mm2pl avatar nerixyz avatar 23rd avatar dependabot[bot] avatar felanbird avatar hemirt avatar tranred avatar leon-richardt avatar cranken avatar dnsge avatar kornes avatar jupjohn avatar talneoran avatar randers00 avatar rexim avatar ckath avatar anotherfoxguy avatar lajamerrmittesdine avatar datguy1 avatar xel86 avatar losfarmosctl avatar coral avatar iprodigy avatar gempir avatar wissididom avatar brian6932 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.