Code Monkey home page Code Monkey logo

liveu_stats_bot's Introduction

LIVEU STATS BOT

A chat bot that makes it easier to see the current status of the battery and modems.

How do i run this?

Just download the latest binary from releases and execute it.

Config

This config will be automatically generated upon running the binary and saved as config.json.

{
    "liveu": {
        "email": "YOUR LIVEU EMAIL",
        "password": "YOUR LIVEU PASSWORD",
        "id": null,
        "monitor": {
            "battery": true,
            "batteryNotification": [
                99,
                50,
                10,
                5,
                1
            ],
            "modems": true
        }
    },
    "twitch": {
        "botUsername": "TWITCH BOT USERNAME",
        "botOauth": "TWITCH BOT OAUTH",
        "channel": "YOUR TWITCH CHANNEL",
        "adminUsers": ["b3ck", "travelwithgus"],
        "modOnly": true
    },
    "commands": {
        "cooldown": 5,
        "stats": ["!lustats", "!liveustats", "!lus"],
        "battery": ["!battery", "!liveubattery", "!lub"],
        "start": "!lustart",
        "stop": "!lustop",
        "restart": "!lurestart",
        "reboot": "!lureboot",
        "delay": "!ludelay"
    },
    "rtmp": {
        "url": "http://localhost/stat",
        "application": "publish",
        "key": "live"
    },
    "customPortNames": {
        "ethernet": "ETH",
        "wifi": "WiFi",
        "usb1": "USB1",
        "usb2": "USB2",
        "sim1": "SIM1",
        "sim2": "SIM2"
    }
}

Optional config settings

You can remove these settings from the config if you don't want them or replace them with null.

Name Description
id When using mutliple units you can set a default unit by using the bossid
adminUsers A list of twitch usernames e.g. ["715209", "b3ck"]
rtmp If you are using nginx you can also show the bitrate when using the stats command
customPortNames Customize the port names

Chat Commands

After running the app successfully you can use the following default commands in your chat:

Name Default command Description
stats !lus Shows the current connected modems and bitrate
battery !lub Shows the current battery charge percentage
start !lustart Starts the stream (not the unit)
stop !lustop Stops the stream
restart !lurestart Restarts the stream
reboot !lureboot Reboots the unit
delay !ludelay Toggles between low delay and high resiliency mode

You can add, delete or change the commands to whatever you want in config.json under the commands section.

The start, stop and restart commands are only available to the channel owner or adminUsers.

Give specific users access to all commands

Add the twitch username in adminUsers like this: ["715209", "b3ck"].

Possible Chat Command Results:

If your LiveU is offline you'll see this in chat:

ChatBot: LiveU Offline :(

If your LiveU is online and ready you'll see this in chat:

ChatBot: LiveU Online and Ready

If your LiveU is online, streaming but not using NGINX you'll see this in chat:

ChatBot: WiFi: 2453 Kbps, USB1: 2548 Kbps, USB2: 2328 Kbps, Ethernet: 2285 Kbps, Total LRT: 7000 Kbps

If your LiveU is online, streaming and you're using NGINX you'll see this in chat:

ChatBot: WiFi: 2453 Kbps, USB1: 2548 Kbps, USB2: 2328 Kbps, Ethernet: 2285 Kbps, Total LRT: 7000 Kbps, RTMP: 6000 Kbps

Please note: if one of your connections is offline it will NOT show up at all in the stats.

Credits:

Cinnabarcorp (travelingwithgus): Initial Idea, Feedback, Use Case, and Q&A Testing.

B3ck: Feedback and Q&A Testing.

liveu_stats_bot's People

Contributors

715209 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

liveu_stats_bot's Issues

Improvements

If power-connection to LiveU is not 'perfect', and LiveU sometimes gets disconnection from power-source and back on, it will spam the chat like:

LiveU: Now charging
LiveU: Fully charged
LiveU: Now charging
LiveU: Fully charged
etc.

Option: Possibility the disable 'charge status', to disable the notifications above, but still keep percentage-status notifications. So it will not notify anything before eg. 50% if that' s the first warning-level in config.

"modems": true

config.json-> "modems": true

Liveu: monitoring modems
thread 'tokio-runtime-worker' panicked at 'called Result::unwrap() on an Err value: RequestFailed(reqwest::Error { kind: Decode, source: Error("invalid type: null, expected a string", line: 1, column: 173) })', D:\a\liveu_stats_bot\liveu_stats_bot\src\liveu_monitor.rs:30:14
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

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.