public async Task <RuntimeResult> ScheduleEvent(string date, string time, [Remainder] string message) { try { DateTime?parsedDate; TimeSpan?parsedTime; ParseDateTime(date, time, out parsedDate, out parsedTime); if (!parsedDate.HasValue || !parsedTime.HasValue) { throw new ArgumentException("Expecting both date and time to schedule new event"); } DateTime targetDate = parsedDate.Value + parsedTime.Value; int id = _schedulingService.ScheduleEvent(Context.Guild.Id, Context.User.Username, message, targetDate); await ReplyAsync(string.Format("Added event [{0}] at {1}", id, targetDate.ToString("dd.MM.yyyy HH:mm"))); return(CommandResult.FromSuccess()); } catch (Exception ex) { _logger.LogError(ex, ex.ToString()); return(CommandResult.FromError(ex.Message)); } }