TwitchPinChatMessage

Pins a chat message in Twitch

Signature

public bool TwitchPinChatMessage(string messageId, Int32? duration)

Parameters

messageId
string required

Twitch chat message ID to pin

duration
Int32?

The duration to pin the chat message for.

  • null for the pin to last till the end of the stream
  • between 30 and 1800 - duration in seconds

Return Type

bool

Example

using System;
public class CPHInline
{
    public bool Execute()
    {
        // get the message id from an argument
        if (!CPH.TryGetValue<string>("msgId", out var msgId))
        {
            return false;
        }

        // pin the chat message till the end of the stream
        CPH.TwitchChatPinChatMessage(msgId);

        return true;
    }
}