# First Command (First Chatter)

**URL:** <https://extensions.streamer.bot/t/first-command-first-chatter/116>\
**Category:** Unapproved/Deprecated\
**Tags:** chat, twitch\
**Created:** [June 30, 2023, 12:17am UTC](https://extensions.streamer.bot/t/first-command-first-chatter/116 "2023-06-30T00:17:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emongev](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/emongev/32/968_2.png) [@emongev](https://extensions.streamer.bot/u/emongev)\
**Post date:** [June 30, 2023, 12:17am UTC](https://extensions.streamer.bot/t/first-command-first-chatter/116/1 "2023-06-30T00:17:52Z")

</div>

# Description

Let chat know who was first with Streamer.bot.

# Import Code

```csharp
using System;

public class CPHInline
{
    public bool Execute()
    {
        DoFirstCommand(args["user"].ToString());
        return true;
    }

    private void DoFirstCommand(string pUser)
    {
        string temporaryFirstUser = CPH.GetGlobalVar<string>("temporaryFirstUser", false);
        int userFirstScore = CPH.GetUserVar<int>(pUser, "firstScore", true);

        if(temporaryFirstUser == null)
        {
            CPH.SendMessage("You are the first!", true);

            
            userFirstScore = userFirstScore + 1;
            CPH.SetUserVar(pUser, "firstScore", userFirstScore, true);

            CPH.SetGlobalVar("temporaryFirstUser", pUser, false);
        }
        else
        {
            string prettyFirst = temporaryFirstUser;
            if(temporaryFirstUser == pUser)
            {
                prettyFirst = "you, of course!";
            }
            CPH.SendMessage("You have been first " + userFirstScore + " times. Today's first person here was: " + prettyFirst, true);
        }
        
    }
}

```

# Contributors

- [emongev](https://www.twitch.tv/emongev)
