This version works with Create React App for production. There was a problem with the original tmi.js when it came to building that didn't work with CRA. Using this version will get rid of the issue and will work on CRA.
Website | Documentation currently at tmijs/docs | Changelog on the release page
npm i tmi.js
const tmi = require('tmi.js');
const client = new tmi.Client({
options: { debug: true },
connection: {
reconnect: true,
secure: true
},
identity: {
username: 'bot-name',
password: 'oauth:my-bot-token'
},
channels: [ 'my-channel' ]
});
client.connect();
client.on('message', (channel, tags, message, self) => {
if(self) return;
if(message.toLowerCase() === '!hello') {
client.say(channel, `@${tags.username}, heya!`);
}
});
yarn add react-tmi
Emote-sets will no longer work considering the url was sending 400 errors
$ git clone https://github.com/ahadcove/react-tmi.git
$ yarn
$ yarn build
yarn add -D @types/tmi.js