Example #1
0
        public int CreateNewReminder(IDiscordMessageChannel channel, string text, TimeSpan at, bool repeated)
        {
            int?id = GetRandomKey();

            if (id == null)
            {
                return(-1);
            }

            ReminderInstance reminder = new ReminderInstance(id.GetValueOrDefault(), this, text);

            if (repeated)
            {
                reminder.RepeatReminder = true;
            }

            reminder.StartTime = DateTime.Now;
            reminder.Length    = at;

            reminder.Start(channel);

            instances.Add(id ?? 0, reminder);

            return(id.GetValueOrDefault());
        }
Example #2
0
        public int CreateNewReminder(IDiscordMessageChannel channel, string text, TimeSpan at)
        {
            int?id = GetRandomKey();

            if (id == null)
            {
                return(-1);
            }

            ReminderInstance reminder = new ReminderInstance(id.GetValueOrDefault(), this, text);

            reminder.Start(channel, at);

            instances.Add(id ?? 0, reminder);

            return(id.GetValueOrDefault());
        }