Twitch Chat Bot

Version 2.0 by

Site ID: 113

Posted: July 28 2021

Last updated: July 28 2021

Downloads 7
Download TwitchChatBot.zip (1.61 KB)

How to install plugins


Twitch Chat Bot

Twitch Chat Bot in an OpenPlanet plugin for Trackmania 2020 that answer to commands. It can display the map you're playing, the server you're on, your personnal best time, a link to the map you're playing and a few more configurable fields.

Installation

Put the files in your OpenPlanet directory which is located under:

C:\Users\<username>\OpenplanetNext\Scripts\TwitchChat

So that it looks like this:

Scripts/
├─ TwitchChat/
│  ├─ Plugin_TwitchChat.as

Dependency

You will need Nsgr's Twitch Base library. You need to download it here. Place it at the root of your Scripts folder:

C:\Users\<username>\OpenplanetNext\Scripts\

So that it looks like this:

Scripts/
├─ Twitch/
│  ├─ [...].as
│  ├─ [...].as.sig
├─ Plugin_TwitchBase.as

Settings

Parameters

You'll need to update the plugin settings tab under the Twitch Base with some informations:

  • Twitch OAuth Token that you can get from here.
  • Twitch Nickname is the Twitch nickname from the channel you'll be streaming on.
  • Twitch Channel which is, as the name suggests, your Twitch channel, preceded by #.

⚠ All other settings will be under the Twitch Chat Bot tab. ⚠

Commands

  • You can enable or disable specific commands. (⚠ please note that some characters will not work because they are locked by Twitch, such as /, //, @ or .)
  • You can configure the command prefix (example: !)
  • You can configure the command strings (example: map, server, pb and url)

Strings

You can configure every strings that will be posted in the chat.

You will have variables available for every command:

  • Map:
    • {name} - map name
    • {author} - map author
  • Server:
    • {name} - server name
    • {nbr_player} - current player count
    • {max_player} - number of slots of current serveur
  • Personnal best time:
    • {pb} - personnal best time
  • URL:
    • {url} - map URL

You can place these variables wherever you want inside the associated field.

Note: You can paste emojis from outside OpenPlanet and they will work. It will display a ? but will still work.

Usage

Once properly configured, just launch Trackmania and it should connect to your Twitch chat automatically.

Contributing

You can submit pull requests on the GitHub project. For major changes, please open an issue first to discuss what you would like to change.

Please note that this is my first plugin so it might have some bugs. Please post an issue on Github or send me a message on Discord bmx22c#0001. Thanks and enjoy !

Changelog

2.0

Upgraded to work with Nsgr's Twitch Base plugin

1.0

Initial release