Exemple #1
0
        private async void HandleExpiredReminder(object state)
        {
            TReminder reminder = state as TReminder;

            await this._reminderDAO.RemoveAsync(reminder);

            StopTimer(this.BuildTimerKey(reminder.UserId, reminder.ExpirationTime));

            IMessageChannel channel = await ChannelProvider.GetDMChannelAsync(this._client, reminder.UserId);

            FormattedEmbedBuilder message = new FormattedEmbedBuilder()
                                            .AppendTitle($"{XayahReaction.Clock} Reminder expired")
                                            .AppendDescription(reminder.Message);
            await channel.SendEmbedAsync(message);
        }
Exemple #2
0
 public async Task AddNewAsync(TReminder reminder)
 {
     await this._reminderDAO.SaveAsync(reminder);
     await StartAsync();
 }