Appearance
Class: FollowEvent
Represents a new follower on the channel (Twitch channel.follow event).
Remarks
You never instantiate this yourself: the SDK hands it to the callback of `k.twitch.onFollow`. The viewer's public fields (user_login, user_name, user_id) are available synchronously; use getUser to resolve the full Kappapps viewer (currency, role, items…), which requires a lookup.
Example
ts
k.twitch.onFollow((event) => {
k.chat.say(`Thanks for the follow, ${event.user_name}! 💜`);
});Properties
broadcaster_user_id
ts
broadcaster_user_id: string;Twitch id of the broadcaster (the channel that was followed).
broadcaster_user_login
ts
broadcaster_user_login: string;Twitch login of the broadcaster.
broadcaster_user_name
ts
broadcaster_user_name: string;Twitch display name of the broadcaster.
followed_at
ts
followed_at: string;ISO-8601 date at which the follow happened, as reported by Twitch.
received_at
ts
received_at: number;Timestamp (in milliseconds) at which the SDK received the event.
user_id
ts
user_id: string;Twitch id of the viewer who followed.
user_login
ts
user_login: string;Twitch login (lowercase username) of the viewer who followed.
user_name
ts
user_name: string;Twitch display name of the viewer who followed.
Methods
getFollowedAt()
ts
getFollowedAt(): Date;Returns the moment the follow happened as a Date.
Returns
Date
The follow date.
getUser()
ts
getUser(): Promise<User>;Resolves the full Kappapps viewer who followed (currency, role, items…).
Returns
Promise<User>
The matching User, or null if the viewer is unknown to the platform.
Remarks
Requires a lookup — the follow event itself only carries the Twitch identity (user_login/user_name/user_id), not the Kappapps data. If you only need to display the name, use user_name directly.
Example
ts
k.twitch.onFollow(async (event) => {
const user = await event.getUser();
if (user) await user.addCurrency(50);
});