SZAKI-TwitchIntegrationAPI icon

TwitchIntegrationAPI

Adding twitch integration to the game! By its own doesn't do much, but now you can add this to your own mod to handle the twitch!

By SZAKI
Last updated a year ago
Total downloads 903
Total rating 2 
Categories Mods Tools Libraries BepInEx
Dependency string SZAKI-TwitchIntegrationAPI-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

TWITCH INTEGRATION API

This API only purpose to connect the specified twitch chat to the game and let the mod developers the power to create their own commands and execution methods to do something in the game!

Installation

  1. Download the BepInEx and install it
  2. Let the game run once to generate all the important files and folders
  3. Download this mod and place the TwitchIntegrationAPI.dll into the plugins folder
  4. Let the game run once more to generate the config files.
  5. Navigate to the config folder and open the twitch-integration-api.cfg file
  6. Read the descriptions and override the necessary datas to connect it to your twitch chat!
  7. Thats it. Enjoy. :)

How to use

By itself this mod doesn't do too much, but if you want to test if its working, after you installed it run the game and open your twitch chat and write !ping into the chat. If you see a response in your game console liek this " EXECUTING PING..." then your all done and the plugin is working! :)

For the developers

How to integrate into your mod

To use this plugin as an API, first import the TwitchIntegrationAPI.dll file into your project as reference (just like the Assembly), then write the following line before your BaseUnityPlugin class
Imgur

After that, create a variable to store the API for later use like this
Imgur

In the Awake function get the instance of the Base plugin and give it to the already created variable
Imgur

Thats it, now your mod depends on the TwitchIntegrationAPI

Creating new commands

To create a new command and register it into the twitch api, first you have to create a new class and inherit it from the Command class like this
Imgur

After that the class requires you to create a constructor like the in the picture and an override method Execute method.
If you don't want to specify a name later on when you create a new instance of this class, then you could change the constructor to look like this
Imgur

The command name is not key sensitive!
You could write your own processing method inside the Execute method!
The args here contains any other parameters then the command name itself (for example: !HELLO szaki
In this case the command name is hello the parameters are szaki)\

To register your command go back to your BaseUnityPlugin where in this example we specified the api and add the following line
Imgur

Thats it, now you can register as many command as you want and my API handles the rest. :)

About me

If you have any suggestion or question about it, heres my discord: szkristof97 (SZAKI)