Esempio n. 1
0
        public async Task <string> GetChannelsListAsync()
        {
            var               response    = webClient.DownloadString($"https://slack.com/api/conversations.list?token={token}&pretty=1");
            dynamic           stuff       = JsonConvert.DeserializeObject(response);
            SlackGetResponses newResponse = new SlackGetResponses();

            foreach (dynamic item in stuff.channels)
            {
                newResponse.channel += item.id += Environment.NewLine;
            }
            return(newResponse.channel);
        }
Esempio n. 2
0
        public async Task <string> GetMessageAsync(string channel)
        {
            var               response    = webClient.DownloadString($"https://slack.com/api/conversations.history?token={token}&channel={channel}&pretty=1");
            dynamic           stuff       = JsonConvert.DeserializeObject(response);
            SlackGetResponses newResponse = new SlackGetResponses();

            foreach (dynamic item in stuff.messages)
            {
                newResponse.text += item.text += Environment.NewLine;
            }
            newResponse.message += newResponse.text;
            return(newResponse.message);
        }