Пример #1
0
        public async Task NextAppointments()
        {
            try {
                var appointments = await ReaderService.ReadCurrentAppointments();

                StringBuilder response = new StringBuilder();

                // the two blanks in front of linebreak are needed because discord uses Markdown
                response.Append($"Hier die Termine für dich, {Context.User.Mention}: \n");
                foreach (var appointment in appointments)
                {
                    response.Append($"> {appointment.Date.ToString("dddd, dd.MM.yyyy", new CultureInfo("de-DE"))}  \n");
                }

                await ReplyAsync(response.ToString());
            }
            catch (Exception ex) {
                Logger.LogError($"Die Termine konnte nicht eingeholt werden: {ex}");
                await ReplyAsync("Leider kann ich dir die Termine im Moment " +
                                 "nicht sagen, weil ein Fehler aufgetreten ist .....");
            }
        }