@twitchapi/chatbot v2.0.3
TWITCHAPI/CHATBOT
This powerful node module allows you to customize your own Twitch Bot.
FIRST STEPS
First of all you have to create a new Twitch Developer Application. Later you have to generate a user access token with the account you want to make a bot and include the scopes chat:edit and chat:read to be able to read and send messages. You can also include other scopes that are needed to be able to execute some actions like ban users, delete messages, etc...
Then you can build your own TWITCH BOT
EXAMPLE CODE
This is an example about how to build your first bot and make a dice command!
```js
import { ChatBot, Events } from "@twitchapi/chatbot"
const chatbot = new ChatBot({ capabilities: { membership: true, commands: true, tags: true }, clientID: "clientID", channels: ["mychannel"], oauth: "token", nick: "chatbotUsername" }) // You have to include the ChatBot capabilities, is recommended to include both three and the channels the bot will join at the start of the application.
chatbot.on(Events.Ready, () => {
console.log(`Welcome ${chatbot.user.login} to the ChatBot!`)
})
chatbot.on(Events.PrivMsg, (message) => {
if(message.content === "!dice"){
return message.reply(`The dice point to the number ${Math.floor(Math.random() * 6)}`)
}
})
chatbot.login()
```
You can search for the package's documentation in https://pablornc.github.io/twitchapi/
You are free of making a pull request in the official github repository!
23 days ago
24 days ago
26 days ago
26 days ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
6 months ago
8 months ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago