public async void SendMessageImage(string to, byte[] ImageData, WhatsAPI.UniversalApps.Libs.Constants.Enums.ImageType imgtype)
        {
            FMessage msg = await this.getFmessageImage(to, ImageData, imgtype);

            if (msg != null)
            {
                this.SendMessage(msg);
            }
        }
        protected async Task <FMessage> getFmessageImage(string to, byte[] ImageData, WhatsAPI.UniversalApps.Libs.Constants.Enums.ImageType imgtype)
        {
            string type      = string.Empty;
            string extension = string.Empty;

            switch (imgtype)
            {
            case WhatsAPI.UniversalApps.Libs.Constants.Enums.ImageType.PNG:
                type      = "image/png";
                extension = "png";
                break;

            case WhatsAPI.UniversalApps.Libs.Constants.Enums.ImageType.GIF:
                type      = "image/gif";
                extension = "gif";
                break;

            default:
                type      = "image/jpeg";
                extension = "jpg";
                break;
            }

            //create hash
            string filehash = string.Empty;
            SHA256 sha      = SHA256.Create();

            byte[] raw = sha.ComputeHash(ImageData);
            filehash = Convert.ToBase64String(raw);


            //request upload
            UploadResponse response = await this.UploadFile(filehash, "image", ImageData.Length, ImageData, to, type, extension);

            if (response != null && !String.IsNullOrEmpty(response.url))
            {
                //send message
                FMessage msg = new FMessage(to, true)
                {
                    media_wa_type   = FMessage.Type.Image,
                    media_mime_type = response.mimetype,
                    media_name      = response.url.Split('/').Last(),
                    media_size      = response.size,
                    media_url       = response.url,
                    binary_data     = await this.CreateThumbnail(ImageData, "thumb-" + response.url.Split('/').Last())
                };
                return(msg);
            }
            return(null);
        }
        public async void SendMessageBroadcastImage(string[] recipients, byte[] ImageData, WhatsAPI.UniversalApps.Libs.Constants.Enums.ImageType imgtype)
        {
            string        to;
            List <string> foo = new List <string>();

            foreach (string s in recipients)
            {
                foo.Add(Helpers.GetJID(s));
            }
            to = string.Join(",", foo.ToArray());
            FMessage msg = await this.getFmessageImage(to, ImageData, imgtype);

            if (msg != null)
            {
                this.SendMessage(msg);
            }
        }