Requires
– BlushyFace.Twitch.Chat.V2

 

Example #1 handle (re)subs
Send a message in chat when a new subscriber has joined the sub club, if the subscriber has subbed for less than a year send a message in chat that they have subbed x months and finally if the subscriber has subbed for a year or longer tell them they have subbed for over a year.

The x.Tags.GetSubscriber(); method contains all the relevant (re)sub info such as the user who subbed, how many months, is it a sub streak, type of sub (prime, tier 1 / 2 / 3) etc.

var subscriber = e.Tags.GetSubscriber();
switch (subscriber.Months)
{
    case 1:
        await client.SendMessage(e.Channel, $"{subscriber.UserName} thanks for the {subscriber.PlanName} sub and welcome to the sub club!");
        break;
    case { } months when (months >= 2 && months < 12):
        await client.SendMessage(e.Channel, $"Wow {subscriber.UserName} thanks for subscribing for {subscriber.Months} months!");
        break;
    case { } months when (months >= 12):
        await client.SendMessage(e.Channel, $"Wow {subscriber.UserName} thanks for subscribing for over a year!");
        break;
}

 

Example #2 handle cheers
When someone cheers over 10k bits send a message by thanking them.

var bits = e.Tags.GetBits();
if (bits >= 10000)
    await client.SendMessage(e.Channel, $"Wow {e.UserName} thanks for cheering {bits} bits!");

USERNOTICE types that are handled
– Sub
– Resub
– Subgift
– Anonsubgift
– Submysterygift
– Giftpaidupgrade
– Rewardgift
– Anongiftpaidupgrade
– Raid
– Unraid
– Ritual
– Bitsbadgetier
– Primepaidupgrade
– Standardpayforward

I’m aware that not every type is handled (the ones from the Twitch doc are covered though) but I will add them when I encounter them.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
Blushyface is LIVE NOW! CLICK TO VIEW
Blushyface is CURRENTLY OFFLINE