# Twitch Live Announcer (v.1.8.0)

### Prerequisites:

* Java 11+
* [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/) (to use placeholderAPI features)
* [Twitch API Key](https://dev.twitch.tv/console/apps)

### Installation:

To install this plugin [download ](https://www.spigotmc.org/resources/twitch-live-announcer.107784/)it from spigot and put it in you plugin folder

### Configuration files:

* [config.yml](https://github.com/ax3lt/Twitch-Live-Announcer/blob/master/src/main/resources/config.yml)
* [messages.yml](https://github.com/ax3lt/Twitch-Live-Announcer/blob/master/src/main/resources/messages.yml)

### Config walkthrough:

<details>

<summary><code>reload_time: 60</code></summary>

This is the time in seconds how often the plugin will check the status of the channels specified in the configuration

</details>

<details>

<summary><code>client_id: ''</code><br><code>client_secret: ''</code></summary>

These are the most important settings of the plugin, here you have to specify you twitch token to be able to get information from the channels\
\
To get this token you have to go to [this ](https://dev.twitch.tv/console/apps)page\
After the login you will be presented to a page like this\
![](https://2667138181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_-mFV-Up5VGIn0F99p%2Fuploads%2FADgmUlzaXWEic3Ksw9LY%2Fimage.png?alt=media\&token=f1b65893-d475-4efe-8b24-4dc8f5e97405)\
Here you have to click "Register your application", it will ask for a name, oauth redirect url, and category.\
As for the name and category you can insert whatever you like, in the oauth url you can put `http://localhost` as my application does not have necessity of this feature.\
After clicking create you will be brought back to the initial page, here you have to click 'manage' and a page like this will be shown\
![](https://2667138181-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_-mFV-Up5VGIn0F99p%2Fuploads%2FAm7u2AHQBfUUzJDXZAvQ%2Fimage.png?alt=media\&token=90711963-6fc3-4a78-9f25-0823096f7853)\
You can see here you client ID, to generate your client secret you have to click 'New secret'

</details>

<details>

<summary><code>check_updated: true</code></summary>

If this is set to true, the plugin on startup will check if a new version is available on spigot, and notify that in the console

</details>

<details>

<summary><code>channels: []</code></summary>

This is the list of all the channels you want the plugin to check\
\
Example of working list:

```yaml
channels:
  - 'ElSpreen'
  - 'Forsen'
  - 'Dream'
```

All these channels will be audited every "reload\_time" to obtain information on their status (online, offline, stream type)

</details>

{% hint style="warning" %}
For this feature to work you need PlaceholderAPI
{% endhint %}

<details>

<summary><code>linked_users: []</code></summary>

This feature allow you to connect your minecraft player to his twitch channel\
Example:

```yaml
linked_users:
  Dream_minecraft:
  - Dream_twitch_channel
```

After you link a player to his channel you can use the placeholder %tla\_status% for example in tab to show the stream status of the player (Online/Offline - Customizable)

</details>

<details>

<summary><code>commands: ...</code></summary>

Here you can specify custom commands to execute when a stream status changes

Default values:

```yaml
commands:
  enabled: false
  start:
    - 'tellraw @a {"text":"%channel% is now streaming","color":"gray"}'
  stop:
    - 'tellraw @a {"text":"%channel% is not streaming anymore","color":"gray"}'
```

In this example when the stream goes live a grey text with written '%channel% is now streaming' will be broadcasted to all players

</details>

<details>

<summary><code>Filters</code></summary>

**Filtering stream game:**\
In this section you can check for specific games streamed (this is a setting from the streamer end)\
Default values:

```yaml
filter-stream-type:
  enabled: false
  games:
    - 'Minecraft'
```

\
**Filtering stream title:**\
Here you can check for a specified string in the title of the stream, useful if you want for example to set the online status of the live only if the title contains your server name

```yaml
filter-stream-title:
  enabled: false
  text:
    - 'Minecraft server!'
```

</details>

<details>

<summary><code>placeholders: ...</code></summary>

These are the values of the placeholder that shows the stream information, they are the same shown by link feature

Default values:

```yaml
placeholders:
  enabled: true
  live: '&c[Live]'
  offline: '&7[Offline]'
```

</details>

<details>

<summary><code>bungee: ...</code></summary>

This feature allows you to send the stream start stop message to all the servers on you bungeecord network (beta feature)

</details>

<details>

<summary>Disable streaming messages</summary>

When set to true the corresponding message broadcast will be disabled

```yaml
disable-streaming-message: false
disable-not-streaming-message: false
```

</details>
