kritzware / twitch-bot

🤖 Easily create chat bots for Twitch.tv
https://www.npmjs.com/package/twitch-bot
MIT License
146 stars 38 forks source link

New Features #21

Open kritzware opened 6 years ago

kritzware commented 6 years ago

Hello twitch-bot users!

This issue is for discussion around ideas/requests for new features, feel free to leave a comment if you have any thoughts 😄

kritzware commented 6 years ago

Some thoughts:

Bot.define(commands)


- More examples, with an example folder e.g. how to setup commands, how to use the bot for chat stats/monitoring etc.

- Built in rate limiter to avoid bot spam, something along these lines
```javascript
const Bot = new TwitchBot({
  username: 'bot',
  oauth: 'oauth:oauth-key-123',
  channels: ['twitch'],
  limit: 10 // Sets limit of 10 IRC messages per 30 seconds, or some other timespan 
})
michael-luo commented 6 years ago

I think rate limiter is definitely a priority for anyone who wants to use this library in a production environment.

Getting the core features done right on this bot might be more important than implementing extra features. It could be hard to gain adoption if people realize that they have to reimplement the core of the bot to make it more resilient.

When receiving a message event, maybe we should have the chance to check if the Bot is currently being rate limited so that they can decide whether to continue further in their business logic or just to ignore the message?

Questions:

PBug90 commented 6 years ago

Regarding message limits: https://dev.twitch.tv/docs/irc#irc-command-and-message-limits

Regarding join limits: https://discuss.dev.twitch.tv/t/the-final-answer-on-join-limits/8505

Such a limitation is definitely useful. For other features, maybe we should keep the "core" of the bot clean so we just implement all raw Twitch-Chat related message parsing and handling and then delegate additional features to a plugin-system?

tcarlsen commented 6 years ago