Git Product home page Git Product logo

strumbot's Introduction

docker-pulls release

Strumbot

A Twitch Stream Notification Bot. This will send notifications to a webhook in your Discord server when the subscribed streamer goes live or changes their game.

Requirements

  • JDK 11 or better
  • Stable Internet

Configurations

The configuration file must be called config.json and has to be in the working directory. An example configuration can be found in example-config.json. Anything marked with (optional) can be set to null to be disabled.

Logger

In this section you can configure some custom logging pattern and the minimum logging level to show in your Discord Webhook. By default, this will only log for messages with level WARN or ERROR.

  • level The severity level at which to start logging (INFO > WARN > ERROR)
  • pattern The custom logback pattern to use

The webhook URL is configured in discord.logging below.

Discord

This section of the configuration contains settings for the discord side of the bot such as role names and webhook URLs. Note that the bot uses global role cache, independent of servers, and it is recommended to only have the bot account in one server.

If you don't know how to create a discord bot and get access to the token: How to make a discord bot

  • token The discord bot token
  • stream_notifications The webhook URL to send stream updates to (see How to create a webhook)
  • role_name Configuration of type->role to change the default names of the update roles (empty value "" disables the role, and removes the role mention from notifications)
  • enabled_events Array of events to publish to the stream_notifications webhook
  • logging Optional webhook URL for errors and warnings printed at runtime (omit or null to disable)
  • show_notify_hints Whether to show a hint in the embed footer about the /notify command

The roles used for updates can be managed by the bot with the /notify role: <type> command. This command will automatically assign the role to the user.

For example, with the configuration "live": "Stream is Live" the bot will accept the command /notify role: live and assign/remove the role Stream is Live for the user. These commands are ephemeral, which means they only show up to the user who invokes them. This way you can use them anywhere without having any clutter in chat!

rank-joining.gif

Events

vod-event.png

  • live When the streamer goes live
  • update When the streamer changes the current game
  • vod When the streamer goes offline (includes vod timestamps for game changes)

Twitch

This configuration section contains required information to track the stream status.

If you don't know how to make a twitch application and access the client_id: How to make a twitch app

  • offline_grace_period Minutes to wait before firing a VOD event after channel appears offline (Default: 2)
  • top_clips The maximum number of top clips to show in the vod event (0 <= x <= 5)
  • client_id The twitch application's client_id
  • client_secret The twitch application's client_secret
  • user_login The username of the tracked streamer

The offline_grace_period is an engineering parameter which is helpful to handle cases where streams temporarily appear offline due to outages or otherwise unwanted connection issues.

Example

{
  "discord": {
    "token": "NjUzMjM1MjY5MzM1NjQ2MjA4.*******.*******",
    "stream_notifications": "https://discord.com/api/webhooks/*******/******",
    "logging": null,
    "show_notify_hints": true,
    "role_name": {
      "live": "live",
      "vod": "vod",
      "update": "update"
    },
    "enabled_events": ["live", "update", "vod"]
  },
  "twitch": {
    "top_clips": 5,
    "offline_grace_period": 2,
    "client_id": "*******",
    "client_secret": "*******",
    "user_login": ["Elajjaz", "Distortion2"]
  }
}

Setup

Currently, I only provide 2 setups. Either docker or through a script. I'm open for pull requests that introduce more or better setups.

Docker

The image is hosted at docker hub.

  1. Open a terminal in the directory of your choice (which includes the config.json!)
  2. Pull the image with docker pull minnced/strumbot:%VERSION% (Replace %VERSION% with the version here: latest release)
  3. Change the configuration in config.json
  4. Create and start a container with this command:
    docker run -d \
      -v ./config.json:/etc/strumbot/config.json \
      --name strumbot \
      --restart unless-stopped \
      minnced/strumbot:%VERSION%

Script

  1. Download the zip archive from the latest release
  2. Unzip and open the resulting directory in a terminal of your choice
  3. Change the configuration in config.json
  4. Run the script for your current platform:
    1. Windows: run.bat
    2. Linux: run.sh

strumbot's People

Contributors

minndevelopment avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

strumbot's Issues

[Feature Request] Support for kick.com notifications

Would it be possible to add support for kick.com as well? Seeming as they just stole the Twitch source code from the leak and slightly modified the design it could perhaps be working fairly similar technically? ๐Ÿ˜

Role name issue

I wanted to use Star-notify other than live for the live role, so I have changed the config file into this:

image

But when I want to use the command /notify role: live I can't:

image

When I use instead the commend /notify role: Star-notify I get this message:

The application did not respond

image

But when I add in the config the role live as one of the other role_name I can yous the command /notify role: live and I geht the role Star-notify and when I go live I get the Notification with Star-notify.

image
image

Have I done something wrong or is this a bug?

Add localization (i18n)

This could be done using ResourceBundle and a config option. For example:

{
  "locale": "en_US",
  "discord": { ... },
  "twitch": { ... }
}

Potentially, we can also find this info through the twitch API and do it automatically. Streams can be set to have a primary language in the directory which we could use, i think.

user_login id

Streamers with display name in their profile will not respond to attempts to track them by entering their ID in user_login.
For example in the image.
stylishnoob4 responds, but
However, the display name "็Œซ็†่ซ–" does not respond to the user_login, even if I type "็Œซ็†่ซ–" or "puioff".
xge3yFo2yv
Cannot be activated exactly
kvnqksIqJv
I tried installing Japanese on ubuntu and changing the character encoding, but I couldn't find a way to fix it!

Question: Tracking multiple Streamer

Hi,

since the documentation is not quite clear, would it be possible to track multiple streamers?
So, in example:
"user_login": ["Test1", "Test2", "Test3]

Best regards,
Shuro

@everyone isnt working properly

Hi,

sorry for the second issue.
I would like to inform everyone in Discord now that XY-Streamer has gone online.
I changed the text in en.properties and de.properties and added @everyone everywhere.
When the notification comes from the bot @everyone is highlighted in blue, but unfortunately no one is notified?
The notifications are then always highlighted in yellow, but this is not.
Is there a workaround there or am I doing something wrong?

best regards

Thumbnails very intermittent

Only just started recently where it has been very hit and miss with thumbnails showing when someone goes live, I'd say it's an 80/20 for the thumbnail to not display at all, not sure if it's an API thing or not. Beforehand it used to be very consistent in delivering them.

Roles

Is it possible to delete the role notifier?
at the moment the bot writes >"@"role" "name" is now Live<, is it possible to delete the @ROLE and only use the Text?

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.