Options
All
  • Public
  • Public/Protected
  • All
Menu

@kararty/dank-twitch-irc

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AnnouncementUsernoticeMessage: AnAnnouncementUsernoticeMessage<"announcement", AnnouncementParameters>
AnonGiftPaidUpgradeParameters: EventParams & { promoGiftTotal?: number; promoGiftTotalRaw?: string; promoName?: string }
AnonGiftPaidUpgradeUsernoticeMessage: SpecificUsernoticeMessage<"anongiftpaidupgrade", AnonGiftPaidUpgradeParameters>
AnonSubgiftParameters: SubgiftParameters
AnonSubgiftUsernoticeMessage: SpecificUsernoticeMessage<"anonsubgift", AnonSubgiftParameters>
BasicTcpTransportConfiguration: Omit<TcpTransportConfiguration, "host" | "port">
BitsBadgeTierUsernoticeMessage: SpecificUsernoticeMessage<"bitsbadgetier", BitsBadgeTierParameters>
Condition: (message: IRCMessage) => boolean

Type declaration

ConnectionPredicate: (conn: SingleConnection) => boolean

Type declaration

CustomRateLimitsConfig: RateLimits
ExpandedClientConfiguration: Required<Omit<ClientConfiguration, "connection" | "password" | "rateLimits">> & { connection: ExpandedTransportConfiguration; password: string | undefined; rateLimits: RateLimits }
ExpandedDuplexTransportConfiguration: Required<DuplexTransportConfiguration>
ExpandedTcpTransportConfiguration: Required<TcpTransportConfiguration> & { preSetup: false }
ExpandedWebSocketTransportConfiguration: WebSocketTransportConfiguration & { preSetup: false }
FunctionPropsOf<T>: { [ K in keyof T as T[K] extends (...args: any) => any ? K : never]: T[K] }

Type parameters

  • T: object

GiftPaidUpgradeParameters: AnonGiftPaidUpgradeParameters & { senderLogin: string; senderName: string }
GiftPaidUpgradeUsernoticeMessage: SpecificUsernoticeMessage<"giftpaidupgrade", GiftPaidUpgradeParameters>
MassSubgiftUsernoticeMessage: SpecificUsernoticeMessage<"submysterygift", MassSubgiftParameters>
OverrideFunction<S, T, K>: (this: S, oldFn: T[K], ...args: Parameters<T[K]>) => ReturnType<T[K]>

Type parameters

  • S

  • T: Record<string, (...args: any) => any>

  • K: keyof T

Type declaration

    • (this: S, oldFn: T[K], ...args: Parameters<T[K]>): ReturnType<T[K]>
    • Parameters

      • this: S
      • oldFn: T[K]
      • Rest ...args: Parameters<T[K]>

      Returns ReturnType<T[K]>

OverrideFunctions<S, T>: { [ K in keyof T as T[K] extends (...args: any) => any ? K : never]?: OverrideFunction<S, T, K> }

Type parameters

  • S

  • T: Record<string, any>

PresetKeys: "default" | "knownBot" | "verifiedBot"
PrivmsgUserState: Omit<UserState, "emoteSets" | "emoteSetsRaw">

Omits emoteSets and emoteSetsRaw from UserState (because they are not sent for PRIVMSG messages)

RaidUsernoticeMessage: SpecificUsernoticeMessage<"raid", RaidParams>
ResubUsernoticeMessage: SpecificUsernoticeMessage<"resub", SubEventParams>
RitualUsernoticeMessage: SpecificUsernoticeMessage<"ritual", RitualParameters>
SubEventParams: EventParams & StreakSubParams & { cumulativeMonths: number; cumulativeMonthsRaw: string; subPlan: string; subPlanName: string }
SubUsernoticeMessage: SpecificUsernoticeMessage<"sub", SubEventParams>
SubgiftUsernoticeMessage: SpecificUsernoticeMessage<"subgift", SubgiftParameters>
TwitchCommands: typeof commandClassMap
TwitchEmoteList: TwitchEmote[]
TwitchEmoteSets: string[]
TwitchFlagList: TwitchFlag[]
TwitchMessageEvents: { [ P in keyof TwitchCommands]: [InstanceType<TwitchCommands[P]>] }

Variables

MAX_OUTGOING_COMMAND_LENGTH: number = ...

Maximum command length (excluding CR LF) the twitch server will accept before chopping the rest off

MAX_OUTGOING_LINE_LENGTH: 4096 = 4096

Maximum line length (including CR LF) the twitch server will accept before chopping the rest off

commandClassMap: { CAP: typeof CapMessage; CLEARCHAT: typeof ClearchatMessage; CLEARMSG: typeof ClearmsgMessage; GLOBALUSERSTATE: typeof GlobaluserstateMessage; HOSTTARGET: typeof HosttargetMessage; JOIN: typeof JoinMessage; NOTICE: typeof NoticeMessage; PART: typeof PartMessage; PING: typeof PingMessage; PONG: typeof PongMessage; PRIVMSG: typeof PrivmsgMessage; RECONNECT: typeof ReconnectMessage; ROOMSTATE: typeof RoomstateMessage; USERNOTICE: typeof UsernoticeMessage; USERSTATE: typeof UserstateMessage; WHISPER: typeof WhisperMessage } = ...

Type declaration

invisibleSuffix: " ó €€" = " \u{000e0000}"
rateLimitPresets: Record<PresetKeys, RateLimits> = ...

Functions

  • acknowledgesCapabilities(requestedCapabilities: string[]): Condition
  • anyCauseInstanceof(error: undefined | Error, constructor: any): boolean
  • applyReplacement<S, T, K>(self: S, target: T, key: K, newFn: OverrideFunction<S, T, K>): void
  • applyReplacements<S, T>(self: S, target: T, replacements: OverrideFunctions<S, T>): void
  • canSpamFast(channelName: string, loggedInUsername: string, userStateTracker?: UserStateTracker): FastSpamResult
  • canSpamFast(channelName: string, loggedInUsername: string, userState: UserState): FastSpamResult
  • causeOf(error: Error): Error | undefined
  • colorToHexString(color: Color): string
  • Make a hexadecimal color string (like e.g. #AABBCC) from a given color object.

    Parameters

    Returns string

  • convertToBoolean(value: string): boolean
  • convertToColor(value: string): Color | undefined
  • convertToInt(value: string): number
  • convertToString(value: string): string
  • convertToTimestamp(value: string): Date
  • convertToTrimmedString(value: string): string
  • correctChannelName(input: string): string
  • decodeValue(value: undefined | string): string | null
  • deniedAnyCapability(requestedCapabilities: string[]): Condition
  • findAndPushToEnd<T>(arr: T[], filter: (t: T) => boolean): T | undefined
  • getCamelCasedName(tagKey: string): string
  • getData<V, A>(ircTags: IRCMessageTags, key: string, converter: (value: string, ...converterArgs: A) => V, ...converterArgs: A): V | undefined
  • Type parameters

    • V

    • A: any[]

    Parameters

    • ircTags: IRCMessageTags
    • key: string
    • converter: (value: string, ...converterArgs: A) => V
        • (value: string, ...converterArgs: A): V
        • Parameters

          • value: string
          • Rest ...converterArgs: A

          Returns V

    • Rest ...converterArgs: A

    Returns V | undefined

  • getIRCChannelName(message: Pick<IRCMessage, "ircParameters">, optional?: false): string
  • getIRCChannelName(message: Pick<IRCMessage, "ircParameters">, optional: true): string | undefined
  • getParameter(message: Pick<IRCMessage, "ircParameters">, idx: number): string
  • ignoreErrors(): undefined
  • isAnonymousUsername(username: string): boolean
  • joinAll(conn: SingleConnection, channelNames: string[]): Promise<Record<string, Error | undefined>>
  • matchingNotice(channelName: string, noticeIDs: string[]): (msg: IRCMessage) => boolean
  • parseActionAndMessage(trailingParameter: string): { isAction: boolean; message: string }
  • parseColor(colorSrc: string): Color
  • parseHostedChannelName(rawHostedChannelName: undefined | string): string | undefined
  • parseHosttargetParameter(rawParameter: string): { hostedChannelName: string | undefined; viewerCount: number | undefined }
  • Parameters

    • rawParameter: string

    Returns { hostedChannelName: string | undefined; viewerCount: number | undefined }

    • hostedChannelName: string | undefined
    • viewerCount: number | undefined
  • parseIntThrowing(str: undefined | null | string): number
  • parseTwitchMessage(messageSrc: string): IRCMessage
  • parseViewerCount(rawViewerCount: undefined | string): number | undefined
  • reasonForValue(actualValue: undefined | null | string): string
  • removeCommands(message: string): string
  • removeInPlace<T>(arr: T[], element: T): void
  • requestCapabilities(conn: SingleConnection, requestMembershipCapability: boolean): Promise<void>
  • requireData<V, A>(ircTags: IRCMessageTags, key: string, converter: (value: string, ...converterArgs: A) => undefined | V, ...converterArgs: A): V
  • Type parameters

    • V

    • A: any[]

    Parameters

    • ircTags: IRCMessageTags
    • key: string
    • converter: (value: string, ...converterArgs: A) => undefined | V
        • (value: string, ...converterArgs: A): undefined | V
        • Parameters

          • value: string
          • Rest ...converterArgs: A

          Returns undefined | V

    • Rest ...converterArgs: A

    Returns V

  • requireNickname(message: Pick<IRCMessage, "ircPrefix">): string
  • requireParameter(message: Pick<IRCMessage, "ircParameters">, idx: number): string
  • sendLogin(conn: SingleConnection, username: string, password?: string): Promise<void>
  • sendPrivmsg(conn: SingleConnection, channelName: string, message: string, replyTo?: string): Promise<void>
  • setDefaults<I, D>(input: undefined | I, defaults: D): I & D
  • splitIntoChunks(bits: string[], separator?: string, limit: number): string[][]
  • unionSets<T>(sets: Set<T>[]): Set<T>
  • validateChannelName(input?: null | string): void
  • validateIRCCommand(command: string): void
  • validateMessageID(input?: null | string): void

Generated using TypeDoc