IrcMessage

sealed interface IrcMessage

Deprecated

Twitch IRC is deprecated. Prefer EventSub for real-time events. IRC remains only for event types not yet available via EventSub (e.g. watch streaks). See: https://dev.twitch.tv/docs/chat/irc-migration/

Sealed hierarchy of parsed Twitch IRC messages.

Twitch IRC is deprecated in favor of EventSub. This model exists solely because EventSub does not yet cover all event types (e.g. watch streaks / viewer milestones). Once Twitch adds full EventSub coverage, this module will be removed.

See: Twitch IRC Migration Guide

Inheritors

Types

Link copied to clipboard
data class ClearChat(val channel: String, val tags: Map<String, String>, val targetUserId: String?, val duration: Int?) : IrcMessage

Chat clear or user ban/timeout (CLEARCHAT).

Link copied to clipboard
data class ClearMsg(val channel: String, val tags: Map<String, String>, val targetMessageId: String, val login: String) : IrcMessage

Single message deletion (CLEARMSG).

Link copied to clipboard
data class Notice(val channel: String, val tags: Map<String, String>, val msgId: String?, val message: String) : IrcMessage

Server notice (NOTICE).

Link copied to clipboard
data class PrivMsg(val channel: String, val tags: Map<String, String>, val userId: String, val userLogin: String, val displayName: String, val message: String) : IrcMessage

A standard chat message (PRIVMSG).

Link copied to clipboard
data class RoomState(val channel: String, val tags: Map<String, String>, val emoteOnly: Boolean?, val followersOnly: Int?, val slow: Int?, val subsOnly: Boolean?) : IrcMessage

Room state change (ROOMSTATE). Fields are nullable because Twitch sends partial updates.

Link copied to clipboard
sealed class UserNotice : IrcMessage

A USERNOTICE message dispatched by Twitch for subscriptions, raids, watch streaks, and other channel events. Subclasses represent specific msg-id values.

Properties

Link copied to clipboard
abstract val channel: String

Channel name without the # prefix.

Link copied to clipboard
abstract val tags: Map<String, String>

Raw IRCv3 tags for direct access when typed fields are insufficient.