Exemplo n.º 1
0
        private async IAsyncEnumerable <ResponseMessage> ListHandlerForChannel(IncomingMessage message, IValidHandle matchedHandle)
        {
            var schedules = _schedulePlugin.ListSchedulesForChannel(message.Channel);

            if (schedules.Any())
            {
                yield return(await Task.FromResult(message.ReplyToChannel("Schedules for channel:")));

                string[] scheduleStrings = schedules.Select(x => x.ToString()).ToArray();
                yield return(message.ReplyToChannel(">>>" + string.Join("\n", scheduleStrings)));
            }
            else
            {
                yield return(message.ReplyToChannel("No schedules set for this channel."));
            }
        }
Exemplo n.º 2
0
        private IEnumerable <ResponseMessage> ListHandlerForChannel(IncomingMessage message, string matchedHandle)
        {
            SchedulePlugin.ScheduleEntry[] schedules = _schedulePlugin.ListSchedulesForChannel(message.Channel);

            if (schedules.Any())
            {
                yield return(message.ReplyToChannel("Schedules for channel:"));

                string[] scheduleStrings = schedules.Select((x, i) => x.ToString(i)).ToArray();
                yield return(message.ReplyToChannel(">>>" + string.Join("\n", scheduleStrings)));
            }
            else
            {
                yield return(message.ReplyToChannel("No schedules set for this channel."));
            }
        }