예제 #1
0
 private void GetChannelsFromSlack()
 {
     if (client == null)
     {
         return;
     }
     client.GetChannelList((response) =>
     {
         SetStatus("Receiving channel list...");
         Dispatcher.BeginInvoke(DispatcherPriority.Input, new Action(() => {
             AddChannels(response);
         }));
     });
 }
예제 #2
0
        public WaitForCommandState(string messageToSend)
        {
            slack = new SlackClient("https://hooks.slack.com/services/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");
            slack.GetChannelList(_ => { });
            var channelId = slack.Channels.FirstOrDefault().id;

            slack.PostMessage(pr => { }, channelId, "testMessageV2", "EveBot1", blocks: new[]
            {
                new ActionsBlock()
                {
                    block_id = "t1", elements = new[]
                    {
                        new ButtonElement()
                        {
                            action_id = "hooray", text = new Text()
                            {
                                text = "Hooray"
                            }
                        },
                    }
                }
            });
        }