"Ready to go" boilerplate with Jest, TMI.js, Nodemon, Config, Babel.
-
Clone repository
-
Install modules
npm i
oryarn install
-
Copy example config
cp config/default.example.json5 config/default.json5
-
Setup bot
oauth_token
you can get here by login via bot
bot: {
username: "your-bots-username-here",
oauth_token: "oauthtokenhere"
},
channel: "your-channel-here"
- Run bot
npm start
Check if user moderator
import { isModerator } from "./utils";
// You can get info about user from incoming message
const user = messageInfo.user;
if (isModerator(user)) {
console.log(`${user.username} is moderate this channel`);
}
Send message to user
import { messageToUser } from "./utils";
// You can get info about user from incoming message
const user = messageInfo.user;
const message = ", thanks for follow dude";
messageToUser(user.username, message);
// In chat:
// your_bot: @devkucher, thanks for follow dude
If you have any comments or ideas - goto new issue.
- Twitch @devkucher
- Me on Medium @KucherDev
- Follow @KucherDev on Twitter
- Have a questions? My telegram