Esempio n. 1
0
    void Countdown(ITriggerMsg e)
    {
        const int maxCountdownSec = 10;
        const int minCountdownSec = 3;

        // cd [seconds]
        if (int.TryParse(e.GetArg(), out int tminus))
        {
            if (tminus >= minCountdownSec && tminus <= maxCountdownSec)
            {
                Countdown(e.ReturnTo, tminus);
            }
        }
        // cd
        else
        {
            Countdown(e.ReturnTo, minCountdownSec);
        }
    }
Esempio n. 2
0
    public void Read(ITriggerMsg e)
    {
        // tell-read [amount]
        var inbox = inboxes.Get(e.Nick);
        var tells = inbox.Read(Amount(e.GetArg()));

        if (tells.Length > 0)
        {
            foreach (TellEntry tellMsg in tells)
            {
                irc.SendNotice(e.Nick, FormatTell(tellMsg));
            }

            irc.SendNotice(e.Nick, " ----- {0} message(s) remaining.", inbox.MessagesCount);
            inboxes.Save(inbox);
        }
        else
        {
            irc.SendNotice(e.Nick, "No messages to read.");
        }
    }