Skip to content
This repository has been archived by the owner on Sep 26, 2018. It is now read-only.

Create Your Bot

Leonardo Mariscal edited this page Apr 30, 2017 · 9 revisions

Make a Class with the name of your Bot (This Case "CavsBot") and Extend it to TwitchBot.

TwitchIRC
package tk.cavariux.twitchirctest.Core;

import com.cavariux.twitchirc.Core.TwitchBot;

public class CavsBot extends TwitchBot
{
}
Light-TwitchIRC
package tk.cavariux.twitchirctest.Core;

import com.cavariux.twitchirc.Core.LightTwitchBot;

public class CavsBot extends LightTwitchBot
{
}

Get an Oauth Key from twitchapps: twitchapps.com/tmi/ your OauthKey may Look like this: "oauth:9kvd020oj3wgcrsyafoaofrt3uv7bi"
Then Make a constructor with your Username and your OauthKey:

public CavsBot ()
{
	this.setUsername("YourUsername"); //this.setUsername("CavsBot"); 
	this.setOauth_Key("YourOauthKey"); //this.setOauth_Key("oauth:9kvd020oj3wgcrsyafoaofrt3uv7bi");
}

After August of 2016 you need a ClientID to access the TwitchAPI, this is not a needed step but will remove some features of the plugin making them return errors/null.
To add a clientID please follow this guide
After that just copy and paste the clientID to the constructor

public CavsBot ()
{
	this.setUsername("YourUsername"); //this.setUsername("CavsBot"); 
	this.setOauth_Key("YourOauthKey"); //this.setOauth_Key("oauth:9kvd020oj3wgcrsyafoaofrt3uv7bi");
	this.setClientID("YourCliendID"); //this.setClientID("axjhfp777tflhy0yjb5sftsil");
}

Then Make a Main Class and create an Object of your Bot

package tk.cavariux.twitchirctest.Core;

public class Main {

	public static void main(String[] args) {
		CavsBot bot = new CavsBot();
	}

}

I changed the imports from 'tk.cavariux' to 'com.cavariux' cause I bought the domain


Next Topic:

Connect to Twitch


Introduction


Medium Stuff


Extra

  • Automatic Messages
  • Custom Commands
  • Coins System

Clone this wiki locally