View Source TMI.MessageServer (tmi.ex v0.4.0)

A GenServer for Sending messages at a specified rate to a single channel.

options

Options

  • :rate (integer) - The rate at which to send the messages. (one message per rate). Optional. Defaults to 1500 ms.

twitch-command-and-message-rate-limits

Twitch command and message rate limits:

If command and message rate limits are exceeded, an application cannot send channel messages or commands for 30 minutes.

| Limit | Applies to |-------------------------------|--------------------------------------------- | 20 per 30 seconds | Users sending commands or messages to | | channels in which they are not the broadcaster | | and do not have Moderator status. | | . | 100 per 30 seconds | Users sending commands or messages to channels | | in which they are the broadcaster or have | | Moderator status. | | . | 7500 per 30 seconds | Verified bots. The channel limits above also | site-wide | apply. In other words, one of the two limits | | above will also be applied depending on | | whether the verified bot is the broadcaster | | or has Moderator status.

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

Link to this section Summary

Functions

Add a command to the outbound message queue.

Add a command to the outbound message queue.

Add a message to the outbound message queue.

Add a message to the outbound message queue.

Returns a specification to start this module under a supervisor.

Invoked to handle asynchronous cast/2 messages.

Invoked to handle all other messages.

Invoked when the server is started. start_link/3 will block until it returns.

Generate the bot and channel specific module name.

Start the message server. Usually because of a JOIN.

Stop the message server. Usually because of a PART.

Stop the message server. Usually because of a PART.

Generate the bot and channel specific module name.

Link to this section Functions

Link to this function

add_command(name, command)

View Source

Specs

add_command(module(), String.t()) :: :ok

Add a command to the outbound message queue.

Link to this function

add_command(bot, channel, command)

View Source

Specs

add_command(module(), String.t(), String.t()) :: :ok

Add a command to the outbound message queue.

Link to this function

add_message(name, message)

View Source

Specs

add_message(module(), String.t()) :: :ok

Add a message to the outbound message queue.

Link to this function

add_message(bot, channel, message)

View Source

Specs

add_message(module(), String.t(), String.t()) :: :ok

Add a message to the outbound message queue.

Returns a specification to start this module under a supervisor.

See Supervisor.

Invoked to handle asynchronous cast/2 messages.

Invoked to handle all other messages.

For example calling Process.send_after(self(), :foo, 1000) would send :foo after one second, and we could match on that here.

Invoked when the server is started. start_link/3 will block until it returns.

Link to this function

module_name(bot, channel)

View Source

Specs

module_name(module(), String.t()) :: module()

Generate the bot and channel specific module name.

Specs

start_link({module(), String.t(), keyword()}) :: GenServer.on_start()

Start the message server. Usually because of a JOIN.

Specs

stop(module()) :: :ok

Stop the message server. Usually because of a PART.

Specs

stop(module(), String.t()) :: :ok

Stop the message server. Usually because of a PART.

Specs

supervisor_name(module()) :: module()

Generate the bot and channel specific module name.