ryanwinchester / tmi.ex

Twitch Messaging Interface for Elixir.
Apache License 2.0
44 stars 7 forks source link

Provide a way to override `@default_message_rate_ms` #15

Closed moniquelive closed 1 year ago

moniquelive commented 2 years ago

I'd like to have the choice do tweak the speed my bot delivers messages to my channel. Currently 1500 ms is unbearable.

https://github.com/ryanwinchester/tmi.ex/blob/main/lib/tmi/channel_server.ex#L33

TIA

ryanwinchester commented 2 years ago

I plan on changing this to better reflect the rate limits based on if the bot is a broadcaster account, verified bot, or not, based on the actual rate limits. For now, it is just conservatively set to prevent from hitting the rate limits for the worst case...

https://dev.twitch.tv/docs/irc#rate-limits

If you hit the rate limit with the bot, then your bot will be ignored by Twitch for 30 minutes 😬.

https://github.com/ryanwinchester/tmi.ex/blob/main/lib/tmi/channel_server.ex#L180-L182

ryanwinchester commented 1 year ago

In 40034b4d31b2999cef5d37830ddc5bc9bf3614de I added a different message rate for when the bot is a moderator, which you add the channels for in config.

From readme example, see the mod_channels option:

config :my_app,
  bots: [
    [
      bot: MyApp.Bot,
      user: "myappbot",
      pass: "oauth:myappbotpassword",
      channels: ["mychannel", "foo"],
      mod_channels: ["mychannel"],
      debug: false
    ]
  ]

Available now in v 0.6.0.