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

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

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:

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

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.

Update the mod status of the bot for the channel.

Functions

Link to this function

add_command(name, command)

View Source
@spec 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
@spec 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
@spec 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
@spec 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
@spec module_name(module(), String.t()) :: module()

Generate the bot and channel specific module name.

@spec start_link({module(), String.t(), boolean(), TMI.Conn.t()}) ::
  GenServer.on_start()

Start the message server. Usually because of a JOIN.

@spec stop(module()) :: :ok

Stop the message server. Usually because of a PART.

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

Stop the message server. Usually because of a PART.

@spec supervisor_name(module()) :: module()

Generate the bot and channel specific module name.

Link to this function

update_mod_status(name, is_mod)

View Source

Update the mod status of the bot for the channel.