GospelBG / ChatPointsTTV

Integrate your world with your Twitch stream. Minecraft in-game interactions through Twitch Channel Points, Bits, Subs and more!
https://modrinth.com/plugin/chatpointsttv
GNU General Public License v3.0
12 stars 1 forks source link
minecraft minecraft-plugin twitch twitch-api

ChatPointsTTV

ChatPointsTTV is a Bukkit plugin that helps you to create interactions between your Twitch stream and your Minecraft world. Set up your own rewards in exchange of channel points, follows, Bits, subs and more! Spawn mobs, give items or run any command when an event is triggered.
There's a whole range of use cases and possibilities to connect with your audience!

Download

This GitHub repository contains all the source code of the plugin. You can download a compiled .jar file through any of this links.

These are the only official download mirrors. Any downloads besides of these links may not be genuine.

Setup

  1. Install the plugin into your Minecraft server.

  2. Open your channel's Twitch Dashboard and create your custom Channel Points Rewards. (optional)

    [!TIP] If needed, you can copy-paste the names of the Channel Points Rewards into a text document for later use.

  3. Set your config.yml up. Adjust the settings and setup events for rewards, donations... You will need to link a Twitch account in order to use the Twitch API (the linked account needs to own/moderate all Twitch channels set in config.yml) There are two ways to link your Twitch account to the plugin:

    • Using a key-based authentication (recommended):
      You will need a Client ID and Access token. You can get one mannually or through a website as Twitch Token Generator. Make sure to add all the needed scopes (the above link is already set to allow the needed scopes).
      Uncomment CUSTOM_CLIENT_ID and CUSTOM_ACCESS_TOKEN on the config file and add your Client ID and Token onto the corresponding fields.
      Once the server has started you just need to run /twitch link and your account will be automatically logged in. You may need to refresh the token when it expires.

    • Log in through a browser:
      You won't need any extra modification in your config.yml file. You will just need to run /twitch link in-game and open the provided link. You may need to log in your Twitch account and authorise the app. Once you finish the log in process you can close the browser and your account will be linked.

      [!WARNING]
      Currently due to API limitations it's only possible to use the browser method if the login link is opened with the same machine the server is being ran on. You also have to repeat this process each time you start the server or reload the plugin.

  4. Set up permissions for:

    • linking/reloading (chatpointsttv.manage).
    • the target player(s) (chatpointsttv.target).
    • people you want the reward messages broadcasted to (chatpointsttv.broadcast).

    · See Permissions for more information.

[!NOTE] The config file for the plugin should be in 'plugins/ChatPointsTTV/config.yml'.

config.yml docs

To reset the original configuration, delete config.yml and reload the plugin. The file will regenerate automatically.
Sections with a (*) are required to be changed in order to the plugin to be used.

Commands

This plugin is controlled by the /twitch command followed by one of the following arguments:

Reward Actions

Currently, there are 2 types of actions:

[!TIP] Argument names surrounded by <> means that it is a required argument. Arguments surrounded by [] are optional.

You should set up your events in your config file following this format:

TYPE_REWARDS:
    - KEY:
        - Action 1
        - Action 2
        - ...

or

TYPE_REWARDS:
    - KEY:
        - STREAMER:
            - Action 1
            - Action 2
            - ...

        - default:
            - Action

Whereas TYPE_REWARDS is replaces with the appropiate config key that is already on the file, KEY with the channel points reward name, subscription tier or minimal amount of bits/subs.

[!IMPORTANT]
For follow events you shouldn't add reward keys. See placeholders on the default config.yml.

[!TIP] You can now target multiple channels. If you do so, you can target some events to a specific channel following the second format. You can still follow the first example if you don't aim to target specific channels.

Twitch Scopes

The latest version of the plugin needs the following scopes to function propertly:

Permissions

Credits

Thanks to Twitch4J for the Java libraries used in this mod to communicate with the Twitch API.

Thanks to urgrue for the code for Twitch authentification.

Thanks to Mystiflow for their color convertion code.