예제 #1
0
        protected override async Task <bool> HandleRequest(PostRequest request)
        {
            if (request.Message.ToLower().StartsWith(GiphyPrefix))
            {
                string searchFor = request.Message.Substring(GiphyPrefix.Length);
                string url       = m_GiphyClient.Translate(searchFor);
                m_PictureBoxPostSentPhoto.Load(url);

                DialogResult res = MessageBox.Show("Do you want to post it?", "Interesting...", MessageBoxButtons.YesNo);
                if (res == DialogResult.Yes)
                {
                    await FacebookApiClient.Instance.PostPictureURLAsync(url, searchFor);

                    request.RequestResult = "Gif Posted successfully!";
                }

                return(false);
            }

            return(true);
        }
예제 #2
0
 protected abstract Task <bool> HandleRequest(PostRequest request);