Skip to content
← Public packages

@kentcdodds/twitch

Monitor Twitch streams, send chat, and update channel settings.

src/send-chat-message.ts

21 lines · 846 B · TypeScript
import { sendChatMessage } from './core.ts'
import type { TwitchSendChatMessageParams, TwitchSendChatMessageResult } from './types.ts'

/**
 * Send a chat message to a Twitch channel as the authenticated user.
 *
 * Guards: requires non-empty broadcasterLogin and message (≤500 chars).
 *
 * @returns Delivery metadata including messageId and isSent flag.
 * @example
 * import sendChatMessage from 'kody:@kentcdodds/twitch/send-chat-message'
 * const result = await sendChatMessage({ broadcasterLogin: 'kentcdodds', message: 'Hello chat!' })
 * // => { broadcasterLogin: 'kentcdodds', senderLogin: '...', messageId: '...', isSent: true }
 */
export default async function twitchSendChatMessage(
	params: TwitchSendChatMessageParams,
): Promise<TwitchSendChatMessageResult> {
	return await sendChatMessage(params)
}

export { sendChatMessage }