Example #1
0
        public static void SetBirthday(ulong userID, DateTime day)
        {
            // Well that's a lot easier than looping each time, these could prove useful to fully understand.
            Date oldDate = birthdays.Find(x => x.userID == userID);
            Date newDate;

            newDate = new Date(userID, day);

            birthdays.Remove(oldDate);
            birthdays.Add(newDate);
            UserConfiguration.SetSetting(userID, "Birthday", newDate);
        }
Example #2
0
        public Task OnMinutePassed(DateTime time)
        {
            if (birthdays != null)
            {
                foreach (Date date in birthdays)
                {
                    // userID = 0 if the user hasn't set a date.
                    if (date.userID == 0)
                    {
                        continue;
                    }

                    DateTime dateThisYear = new DateTime(DateTime.Now.Year, date.day.Month, date.day.Day, date.day.Hour, date.day.Minute, date.day.Second);
                    if (DateTime.Now > dateThisYear && date.lastPassedYear != DateTime.Now.Year)
                    {
                        AnnounceBirthday(date);
                        date.lastPassedYear = DateTime.Now.Year;
                        UserConfiguration.SetSetting(date.userID, "Birthday", date);
                    }
                }
            }
            return(Task.CompletedTask);
        }
Example #3
0
 public Task <Result> Execute(SocketUserMessage e, CultureInfo info)
 {
     UserConfiguration.SetSetting(e.Author.Id, "Culture", info);
     return(TaskResult(info, "Successfully sat culture to " + info.DisplayName));
 }