Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Features #21

Open
kritzware opened this issue Jan 31, 2018 · 4 comments
Open

New Features #21

kritzware opened this issue Jan 31, 2018 · 4 comments

Comments

@kritzware
Copy link
Owner

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
Copy link
Owner Author

kritzware commented Jan 31, 2018

Some thoughts:

  • Defining commands in an object (potentially some sort of config file, or JSON), with helper methods for more advanced commands (e.g. fetching from an api)
const commands = {
  'twitter': 'Check out my twitter at https://twitter.com/twitch! PogChamp',
  '123': chatter => `Message: ${chatter.message}`
  'points': async (chatter) => {
     // Access to the chatter object
     const points = await fetchPointsFromDatabase()
     return `You have ${points} points ${chatter.username}!`
  }
}

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

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
Copy link

michael-luo commented Feb 1, 2018

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:

  • Commands should be customizable for each channel that the Bot is connected to right?

  • Do we also need to rate limit joins and parts per channel so that one channel can't be spammed with JOINs and affect other channels who are also trying to be joined? The current limit is 50 joins per 15 seconds I think

  • Currently, if the message rate limit is reached in one channel, does that stop the Bot from sending messages in other channels as well?

@PBug90
Copy link
Contributor

PBug90 commented Feb 1, 2018

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
Copy link

  • adding event for user join and part
  • adding event for cheer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants