Exemple #1
0
        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);
        }
Exemple #2
0
        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");
            }
        }