public Task <string> SendActionMessageAndWait(string channel, string message, SlackInteractiveMessage messageData) { var requestId = (new Guid()).ToString(); var tcs = new TaskCompletionSource <string>(); SQSSubscriber.WaitFor(requestId, (selected) => { tcs.SetResult(selected); }); messageData.CallbackId = requestId; SendActionMessage(channel, message, messageData); return(tcs.Task); }
public static void Run() { if (Configuration == null) { throw new InvalidOperationException($"{nameof(Configuration)} -> null"); } InitializeSlack(); InitializeSchedulers(); InitializeHandlers(); if (string.IsNullOrEmpty(Configuration.SQSUrl) == false) { SQSSubscriber.Initialize(Configuration); } if (Handlers.Count == 0) { throw new InvalidOperationException("No handlers found"); } }