示例#1
0
        public async Task ListChannelReminders(IGuildChannel channel = null)
        {
            if (channel == null)
            {
                channel = Context.Channel as IGuildChannel;
            }

            // match all by AuthorId in this guild
            var channelReminders = _reminderService.GetReminderChannel(channel.Id);

            var builder = new EmbedBuilder();

            builder.WithAuthor(Context.Client.CurrentUser);
            builder.WithColor(new Color(255, 204, 77));

            builder.WithTitle(string.Format("Reminders for {0}:", channel.Name));

            foreach (Reminder x in channelReminders)
            {
                var user = await Context.Guild.GetUserAsync(x.AuthorId);

                string descriptionText = string.Format("{0}: `#{2}` {1}", user.Username ?? user.Nickname, x.ReminderText, x.ID);

                builder.AddField(x.ReminderTime.ToString("g"), descriptionText, true);
            }

            await ReplyAsync("", false, builder.Build());
        }