This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { | |
options: { | |
debug: true | |
}, | |
connection: { | |
reconnect: true | |
}, | |
identity: { | |
username: "Noxtroz", | |
password: "oauth:alotofsigns" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tmi = require("tmi.js"); | |
const options = require("./options"); //Your options file | |
//Connect to twitch server | |
const client = new tmi.client(options); | |
client.connect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//on chat | |
client.on("chat", (channel, userstate, message, self) => { | |
//channel is which channel it comes from. Not very usable if you are in one channel only. | |
//Userstate is an object which contains a lot of information, if the user who wrote is a subscriber, what emotes he used etc. | |
//message is the message itself. | |
//self is your bot. | |
if(self) return; //If your bot wrote something, then ignore it because you dont want to listen to your own messages | |
if((message.toLowerCase()).includes("noxtroz")){ //using string.includes is case-sensitive, so it is better to just make it lowercase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am Cronnay on github. | |
* I am sebastianberglon (https://keybase.io/sebastianberglon) on keybase. | |
* I have a public key whose fingerprint is 001D 290A D7D0 1DB4 F9FF 46DF A2FE FDD1 E2D7 9BDE | |
To claim this, I am signing this object: |