Skip to content

Class: RaidEvent ​

Represents an incoming raid: another channel raids yours, bringing its viewers (Twitch channel.raid event, incoming direction).

Remarks ​

Handed to the callback of k.twitch.onRaid. The event describes the raiding channel (from_*) and how many viewers it brought (viewers).

Example ​

ts
k.twitch.onRaid((event) => {
    k.chat.say(`Raid incoming from ${event.from_broadcaster_user_name} with ${event.viewers} viewers! 🚀`);
});

Properties ​

from_broadcaster_user_id ​

ts
from_broadcaster_user_id: string;

Twitch id of the raiding channel.


from_broadcaster_user_login ​

ts
from_broadcaster_user_login: string;

Twitch login of the raiding channel.


from_broadcaster_user_name ​

ts
from_broadcaster_user_name: string;

Twitch display name of the raiding channel.


received_at ​

ts
received_at: number;

Timestamp (in milliseconds) at which the SDK received the event.


to_broadcaster_user_id ​

ts
to_broadcaster_user_id: string;

Twitch id of the raided channel (yours).


to_broadcaster_user_login ​

ts
to_broadcaster_user_login: string;

Twitch login of the raided channel (yours).


to_broadcaster_user_name ​

ts
to_broadcaster_user_name: string;

Twitch display name of the raided channel (yours).


viewers ​

ts
viewers: number;

Number of viewers brought by the raid.

Methods ​

getRaider() ​

ts
getRaider(): Promise<User>;

Resolves the raiding channel as a Kappapps User.

Returns ​

Promise<User>

The matching User, or null if the raider is unknown to the platform.

Remarks ​

Requires a lookup. Use from_broadcaster_user_name directly if you only need to display the raider's name.


getViewers() ​

ts
getViewers(): number;

Returns the number of viewers brought by the raid.

Returns ​

number

The viewer count.