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

A GenServer for Channels that self-rate-limits joins.

Options

  • :rate (integer) - The rate at which to join channels. (one join per rate). Optional. Defaults to 500 ms.

Twitch authentication and join rate limits:

| Limit                         | Applies to
|-------------------------------|-------------------------
| 20 join attempts per 10       | Regular Twitch account
| seconds per user              |
|                               |
| 2000 join attempts per 10     | Verified bot
| seconds per user              |

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

Summary

Functions

Returns a specification to start this module under a supervisor.

Invoked to handle synchronous call/3 messages. call/3 will block until a reply is received (unless the call times out or nodes are disconnected).

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.

Add a channel to the JOIN queue.

List the channels that we have joined.

Get the bot-specific ChannelServer module name.

PART from a channel.

Start the channel server.

Update the moderator status of a mod for a channel.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_call(msg, from, state)

View Source

Invoked to handle synchronous call/3 messages. call/3 will block until a reply is received (unless the call times out or nodes are disconnected).

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.

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

Add a channel to the JOIN queue.

@spec list_channels(module()) :: [String.t()]

List the channels that we have joined.

@spec module_name(module()) :: module()

Get the bot-specific ChannelServer module name.

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

PART from a channel.

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

Start the channel server.

Link to this function

update_mod_status(bot, channel, mod_status)

View Source
@spec update_mod_status(module(), String.t(), boolean()) :: :ok

Update the moderator status of a mod for a channel.