Events

Used to display incoming events.

Action event represents a single incoming message collected from one of the supported event sources. Event payload will differ depending on the event type. The full list of supported event types along with a short description can be found in the table below. That list can be extended the same as more fields can be added to interfaces.

eventTypeIdEvent TypeDescription
1Discord TextPayload can include emojis as UTF symbols and links. Mentions are provided in the text format (@username).
2DLive TextPayload can include emojis as UTF symbols and links in text format. Mentions are provided in the text format (@username).
3DLive EmojiPayload contains a link to image with DLive emoji.
4Twitch TextPayload can include emojis as UTF symbols and links in text format. Mentions are provided in the text format (@username). Twitch emotes are just words in text. The payload includes replaces, which point to emojis in the text. Avatar will be provided only if the user has Display avatar setting enabled.
5YouTube TextPayload can include emojis as UTF symbols and links in text format. Mentions are provided in the text format (@username).
7YouTube Super ChatPayload contains an amount which was donated and currency. Also, a text message can be added to this event.
8YouTube Super StickerPayload contains an amount which was donated and currency. StickerId saved for reference, API does not provide a link to an image. Also, altText which describes sticker added to the text field.
11Facebook (Personal profile) TextPayload can include emojis as UTF symbols and links and mentions in text format. Sometimes Facebook can omit information about the author, so fields inside author are optional. parent field, if present, contains the name of the author of the comment to which this comment was sent as a reply.
12Facebook (Personal profile) StickerExtended payload of the Facebook (Personal profile) Text event. link has a URL of sticker image.
13Facebook (Public page) TextPayload can include emojis as UTF symbols and links and mentions in text format. Sometimes Facebook can omit information about the author, so fields inside author are optional. parent field, if present, contains the name of the author of the comment to which this comment was sent as a reply.
14Facebook (Public page) StickerExtended payload of the Facebook (Public page) Text event. link has a URL of sticker image.
21LinkedIn TextIt can include emojis as UTF symbols and links and mentions in text format. The author can be retrieved only for users who allows getting such information, so this field is optional.
22Trovo TextIt can include emojis as UTF symbols and links and mentions in text format. The author can be retrieved only for users who allows getting such information, so this field is optional.
23YouTube Member MilestoneChannel members can send one special highlighted message per month in live chat to recognize and celebrate how long they've been a member. This feature is available to members who are in, at least, their 2nd consecutive month as a member. Messages can only be sent during live streams or Premieres, and are visible to all viewers.
24X TextX text message. It can include emojis as UTF symbols and links in text format. Mentions are provided in the text format (@username).
25Kick TextKick text message from live chat. Includes author information with user ID and username. Supports custom emotes through the replaces array for emote substitution. Can include emojis as UTF symbols and links in text format. The optional parent field contains the name of the author being replied to
26Kick SubscriptionKick subscription event triggered when a user subscribes to a channel. Includes the subscriber's username and optionally the subscription duration in months (subscribedFor). For gifted subscriptions, includes an array of recipient usernames in giftedTo
28YouTube MembershipYouTube Membership: includes new sponsors and gifted subscriptions
29YouTube Membership GiftingYouTube Membership Gifting: someone gifted membership to other users
32Rumble TextRumble text message from live chat. Includes author information with display name and optional avatar. Supports custom emotes through the replaces array, which provides image URLs and positions for emote substitution in the text. Can include emojis as UTF symbols and links in text format

You can use connectionIdentifier to associate an event with the connection from which it received.

You can't use eventIdentifier to uniquely identify events.

Each event has enough information to render it the same way it shown in Restream chat. If event has some attachments (stickers for example) payload will contain all data so no additional requests need to be made in order to display event content.

Emojis and Replaces

Emojis provided as UTF-8 symbols, so it's your decision about how to render them (Links processing and display is your choice as well.). In cases when event source has a support for custom emojis, replaces will be included into event payload. replaces is an array of objects with required from, to and type fields, where from is a position in the event text from which you should start the replacement and to is a position of replacement end. Replaces provided in reverse order so you can just iterate over them and replace directly in the text and don't worry about replacement position change.

All images used for attachments are stored on event source side. So Restream can't guaranty that all of them will be accessible all the time.

TypeScript Interfaces

Warning

TypeScript syntax, new actions and fields may be added over time

interface IEventTypePayloadBasic {}

interface IEventTypePayloadDiscordText extends IEventTypePayloadBasic {
    author: {
        avatar: string | null;
        discriminator: string;
        id: string;
        name: string;
        nickname: string | null;
        nicknameColor: string | null;
        roles: Array<{
            color: string;
            name: string;
        }> | null;
    };
    bot: boolean;
    text: string;
}

interface IEventTypePayloadDLiveText extends IEventTypePayloadBasic {
    author: {
        avatar: string;
        badges: string[];
        name: string;
        partnerStatus: string;
        role: string;
        roomRole: string;
        subscribing: boolean;
        username: string;
    };
    bot: boolean;
    text: string;
}

interface IEventTypePayloadDLiveEmoji extends IEventTypePayloadBasic {
    author: {
        avatar: string;
        badges: string[];
        name: string;
        partnerStatus: string;
        role: string;
        roomRole: string;
        subscribing: boolean;
        username: string;
    };
    bot: boolean;
    link: string;
}

interface IEventTypePayloadTwitchText extends IEventTypePayloadBasic {
    author: {
        avatar: string | null;
        badges: Array<{
            title: string;
            imageUrl: string;
            clickUrl: string | null;
        }>;
        // color of the nickname and `/me` messages
        color: string | null;
        displayName: string | null;
        id: string;
        name: string;
        subscribedFor: number | null;
        username: string;
    };
    // message created by bot
    bot: boolean;
    contentModifiers: {
        me: boolean;
        whisper: boolean;
    };
    firstMessage: boolean;
    replaces: Array<{
        from: number;
        to: number;
        type: 'imageUrl';
        payload: {
            url: string;
        };
    }>;
    repliedInThread: {
        displayName: string;
        twitchMessageId: string;
        twitchUserId: string;
    } | null;
    repliedTo: {
        displayName: string;
        twitchMessageId: string;
        twitchUserId: string;
    } | null;
    text: string;
    twitchMessageId: string | null;
}

interface IEventTypePayloadYouTubeText extends IEventTypePayloadBasic {
    author: {
        id: string;
        avatar: string;
        displayName: string;
        isChatModerator: boolean;
        isChatOwner: boolean;
        isChatSponsor: boolean;
        isVerified: boolean;
    };
    bot: boolean;
    liveChatMessageId: string;
    text: string;
}

interface IEventTypePayloadYouTubeSuperChat extends IEventTypePayloadBasic {
    author: {
        id: string;
        avatar: string;
        displayName: string;
        isChatModerator: boolean;
        isChatOwner: boolean;
        isChatSponsor: boolean;
        isVerified: boolean;
    };
    bot: false;
    donation: {
        amount: string;
        currencyString: string;
        tier: number;
    };
    liveChatMessageId: string;
    text: string;
}

interface IEventTypePayloadYouTubeSuperSticker extends IEventTypePayloadBasic {
    author: {
        id: string;
        avatar: string;
        displayName: string;
        isChatModerator: boolean;
        isChatOwner: boolean;
        isChatSponsor: boolean;
        isVerified: boolean;
    };
    bot: boolean;
    donation: {
        amount: string;
        currencyString: string;
        stickerId: string;
        tier: number;
    };
    liveChatMessageId: string;
    text: string;
}

interface IEventTypePayloadFacebookPersonalText extends IEventTypePayloadBasic {
    author: {
        id?: string;
        name?: string;
        picture?: string;
    };
    bot: false;
    parent?: {
        name?: string;
    };
    text: string;
}

interface IEventTypePayloadFacebookPersonalSticker extends IEventTypePayloadBasic {
    author: {
        id?: string;
        name?: string;
        picture?: string;
    };
    bot: false;
    parent?: {
        name?: string;
    };
    link: string;
    text: string;
}

interface IEventTypePayloadFacebookPageText extends IEventTypePayloadBasic {
    author: {
        id?: string;
        name?: string;
        picture?: string;
    };
    bot: false;
    parent?: {
        name?: string;
    };
    text: string;
}

interface IEventTypePayloadFacebookPageSticker extends IEventTypePayloadBasic {
    author: {
        id?: string;
        name?: string;
        picture?: string;
    };
    bot: false;
    parent?: {
        name?: string;
    };
    link: string;
    text: string;
}

interface IEventTypePayloadLinkedInText extends IEventTypePayloadBasic {
    author?: {
        avatarUrl?: string;
        name: string;
    };
    bot: false;
    text: string;
}

interface IEventTypePayloadTrovoText extends IEventTypePayloadBasic {
    author?: {
        avatarUrl?: string;
        name: string;
    };
    bot: false;
    text: string;
    replaces: Array<{
        from: number;
        payload: {
            url: string;
        };
        to: number;
        type: 'imageUrl' | string;
    }>;
}

interface IEventTypePayloadYouTubeMemberMilestone extends IEventTypePayloadBasic {
    author: {
        id: string;
        avatar: string;
        displayName: string;
        isChatModerator: boolean;
        isChatOwner: boolean;
        isChatSponsor: boolean;
        isVerified: boolean;
    };
    bot: false;
    liveChatMessageId: string;
    memberMilestone: {
        memberMonth: number;
        memberLevelName?: string;
    };
    text: string;
}

interface IEventTypePayloadXplatformText extends IEventTypePayloadBasic {
    author: {
        id: string;
        avatar?: string;
        displayName: string;
        username: string;
        verified: boolean;
    };
    text: string;
}

interface IEventTypePayloadKickText extends IEventTypePayloadBasic {
    author: {
        id: number;
        username: string;
    };
    parent?: {
        name: string;
    };
    bot: boolean;
    replaces: Array<{
        from: number;
        payload: {
            url: string;
        };
        to: number;
        type: 'imageUrl' | string;
    }>;
    text: string;
}

interface IEventTypePayloadKickSubscription extends IEventTypePayloadBasic {
    author: {
        username: string;
    };
    subscribedFor?: number;
    giftedTo?: string[];
}

interface IEventTypePayloadYouTubeMembership extends IEventTypePayloadBasic {
    author: {
        id: string;
        avatar: string;
        displayName: string;
        isChatModerator: boolean;
        isChatOwner: boolean;
        isChatSponsor: boolean;
        isVerified: boolean;
    };
    bot: false;
    liveChatMessageId: string;
    membership: {
        gift: boolean;
        memberLevelName: string;
    };
    text: string;
}

interface IEventTypePayloadYouTubeMembershipGifting extends IEventTypePayloadBasic {
    author: {
        id: string;
        avatar: string;
        displayName: string;
        isChatModerator: boolean;
        isChatOwner: boolean;
        isChatSponsor: boolean;
        isVerified: boolean;
    };
    bot: false;
    giftMemberships: {
        count: number;
        levelName: string;
    };
    liveChatMessageId: string;
    text: string;
}

interface IEventTypePayloadRumbleText extends IEventTypePayloadBasic {
    author: {
        avatar?: string;
        displayName: string;
        id: string;
        name: string;
    };
    bot: false;
    replaces: Array<{
        from: number;
        payload: {
            url: string;
        };
        to: number;
        type: 'imageUrl' | string;
    }>;
    text: string;
}