public void CreateClip() { TestWrapper(async(MixerConnection connection) => { BroadcastModel broadcast = await connection.Broadcasts.GetCurrentBroadcast(); Assert.IsNotNull(broadcast); Assert.IsTrue(broadcast.id != Guid.Empty); bool canClipBeMade = await connection.Clips.CanClipBeMade(broadcast); Assert.IsTrue(canClipBeMade); ClipRequestModel clipRequest = new ClipRequestModel() { broadcastId = broadcast.id.ToString(), highlightTitle = "Test Clip " + DateTimeOffset.Now.ToString(), clipDurationInSeconds = 30 }; ClipModel createdClip = await connection.Clips.CreateClip(clipRequest); Assert.IsNotNull(createdClip); }); }
/// <summary> /// 廣播訊息 /// </summary> /// <param name="broadcastModel">廣播訊息body資料</param> public async Task BroadcastMessageAsync(BroadcastModel broadcastModel) { string jsonString = JsonConvert.SerializeObject(broadcastModel, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, Formatting = Formatting.None }); await Utility.DoLineHttpPostAsync(MessagingApiUrl.BroadcastUrl, jsonString, accessToken); }
/// <summary> /// Gets whether a clip can be created for the specified broadcast. /// </summary> /// <param name="broadcast">The broadcast to validate</param> /// <returns>Whether a clip can be created for the specified broadcast</returns> public async Task <bool> CanClipBeMade(BroadcastModel broadcast) { Validator.ValidateVariable(broadcast, "broadcast"); HttpResponseMessage response = await this.GetAsync("clips/broadcasts/" + broadcast.id.ToString() + "/canClip"); return(response.StatusCode == HttpStatusCode.OK); }
public static async Task Main(string[] args) { RongCloud rongCloud = RongCloud.GetInstance(appKey, appSecret); /** * * API 文档: * https://www.rongcloud.cn/docs/push_service.html#broadcast * * 广播消息 * **/ BroadcastModel broadcast = new BroadcastModel(); broadcast.SetFromuserid("fromuserid"); broadcast.SetPlatform(new string[] { "ios", "android" }); Audience audience = new Audience(); audience.SetUserid(new string[] { "userid1", "userid2" }); broadcast.SetAudience(audience); Message message = new Message(); message.SetContent("this is message"); message.SetObjectName("RC:TxtMsg"); broadcast.SetMessage(message); Notification notification = new Notification(); notification.SetAlert("this is broadcast"); broadcast.SetNotification(notification); PushResult result = await rongCloud.Broadcast.Send(broadcast); Console.WriteLine("broadcast: " + result); /** * * API 文档: * https://www.rongcloud.cn/docs/push_service.html#push * * 推送消息 * **/ PushModel pushmodel = new PushModel(); pushmodel.SetPlatform(new string[] { "ios", "android" }); audience = new Audience(); audience.SetUserid(new string[] { "userid1", "userid2" }); pushmodel.SetAudience(audience); notification = new Notification(); notification.SetAlert("this is push"); pushmodel.SetNotification(notification); result = await rongCloud.Push.Send(pushmodel); Console.WriteLine("push: " + result); Console.ReadLine(); }
protected override async Task PerformInternal(UserViewModel user, IEnumerable <string> arguments) { if (ChannelSession.Chat != null) { if (this.ShowClipInfoInChat) { await ChannelSession.Chat.SendMessage("Sending clip creation request to Mixer..."); } string clipName = await this.ReplaceStringWithSpecialModifiers(this.ClipName, user, arguments); if (!string.IsNullOrEmpty(clipName) && MixerClipsAction.MinimumLength <= this.ClipLength && this.ClipLength <= MixerClipsAction.MaximumLength) { ClipModel clip = null; DateTimeOffset clipCreationTime = DateTimeOffset.Now; BroadcastModel broadcast = await ChannelSession.Connection.GetCurrentBroadcast(); if (broadcast != null) { if (await ChannelSession.Connection.CanClipBeMade(broadcast)) { clip = await ChannelSession.Connection.CreateClip(new ClipRequestModel() { broadcastId = broadcast.id.ToString(), highlightTitle = clipName, clipDurationInSeconds = this.ClipLength }); } } if (clip == null) { for (int i = 0; i < 10; i++) { await Task.Delay(2000); IEnumerable <ClipModel> clips = await ChannelSession.Connection.GetChannelClips(ChannelSession.Channel); clip = clips.OrderByDescending(c => c.uploadDate).FirstOrDefault(); if (clip != null && clip.uploadDate.ToLocalTime() >= clipCreationTime && clip.title.Equals(clipName)) { await this.ProcessClip(clip, clipName); return; } } await ChannelSession.Chat.SendMessage("ERROR: Unable to create clip or could not find clip, please verify that clips can be created by ensuring the Clips button on your stream is not grayed out."); } else { await this.ProcessClip(clip, clipName); } } } }
public static async Task <DateTimeOffset> GetStartTime() { BroadcastModel broadcast = await ChannelSession.Connection.GetCurrentBroadcast(ChannelSession.Channel); if (broadcast != null && broadcast.online) { DateTimeOffset startTime = broadcast.startedAt.ToLocalTime(); if (startTime > DateTimeOffset.MinValue) { return(startTime); } } return(DateTimeOffset.MinValue); }
public void GetCurrentBroadcast() { TestWrapper(async(MixerConnection connection) => { BroadcastModel broadcast = await connection.Broadcasts.GetCurrentBroadcast(); Assert.IsNotNull(broadcast); Assert.IsTrue(broadcast.id != Guid.Empty); broadcast = await connection.Broadcasts.GetBroadcast(broadcast.id); Assert.IsNotNull(broadcast); Assert.IsTrue(broadcast.id != Guid.Empty); }); }
public void GetChannelBroadcast() { TestWrapper(async(MixerConnection connection) => { ChannelModel channel = await ChannelsServiceUnitTests.GetChannel(connection); Assert.IsNotNull(channel); Assert.IsTrue(channel.id > (uint)0); BroadcastModel broadcast = await connection.Channels.GetCurrentBroadcast(channel); Assert.IsNotNull(broadcast); Assert.AreEqual(channel.id, broadcast.channelId); }); }
/** * 广播 * * @param broadcast 广播数据 * @return PushResult **/ public PushResult Send(BroadcastModel broadcast) { // 需要校验的字段 String message = CommonUtil.CheckFiled(broadcast, PATH, CheckMethod.BROADCAST); if (null != message) { return((PushResult)RongJsonUtil.JsonStringToObj <PushResult>(message)); } String body = RongJsonUtil.ObjToJsonString(broadcast); String result = RongHttpClient.ExecutePost(appKey, appSecret, body, RongCloud.ApiHostType.Type + "/push.json", "application/json"); return((PushResult)RongJsonUtil.JsonStringToObj <PushResult>(CommonUtil.GetResponseByCode(PATH, CheckMethod.BROADCAST, result))); }
public static void SetBroadcast(this IBroadcastService broadcastService) { var broadcastConfigService = Xamarin.Forms.DependencyService.Resolve <BroadcastConfigService>(); var dbresult = broadcastConfigService.GetById(Xamarin.Essentials.DeviceInfo.Model); if (dbresult != null) { if (string.IsNullOrWhiteSpace(dbresult.FileActionName) || string.IsNullOrWhiteSpace(dbresult.BarCodeName)) { return; } var broadcastModel = new BroadcastModel { ActionName = dbresult.FileActionName, StringExtra = dbresult.BarCodeName }; broadcastService.Init(broadcastModel); } }
public void Init(BroadcastModel broadcast) { intentFilter = new IntentFilter(); // intentFilter.AddAction("nlscan.action.SCANNER_RESULT"); intentFilter.AddAction(broadcast.ActionName); networkChangeReceiver = new CommonBarcodeReceiver(broadcast) { ResultEvent = (a, b) => { if (Result != null) { b.Result = b.Result.Trim(); Result(this, b); } } }; register = true; CrossCurrentActivity.Current.Activity.RegisterReceiver(networkChangeReceiver, intentFilter); // this.RegisterReceiver(networkChangeReceiver, intentFilter); }
public void TestInitialize() { IBroadcastModel model = new BroadcastModel(); budget = new LinkBudget(model); }
public void TestInitialize() { model = new BroadcastModel(); }
public async Task <bool> CanClipBeMade(BroadcastModel broadcast) { return(await this.RunAsync(this.Connection.Clips.CanClipBeMade(broadcast))); }
public IHttpActionResult Post([FromBody] BroadcastModel b) { using (CoinpanicContext db = new CoinpanicContext()) { //MonitoringService.SendMessage("Received tx POST " + b.ClaimId, "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId ); CoinClaim userclaim = db.Claims.Where(c => c.ClaimId == b.ClaimId).FirstOrDefault(); if (userclaim == null) { userclaim = new CoinClaim(); } //Clean up the signed transaction Hex string signedTransaction = b.Hex; signedTransaction = signedTransaction.Replace("\n", String.Empty); signedTransaction = signedTransaction.Replace("\r", String.Empty); signedTransaction = signedTransaction.Replace("\t", String.Empty); signedTransaction = signedTransaction.Trim().Replace(" ", ""); userclaim.SignedTX = signedTransaction; userclaim.SubmitDate = DateTime.Now; db.SaveChanges(); BroadcastResponse response = new BroadcastResponse() { Error = false, Result = "Transaction successfully broadcast.", Txid = "", }; var tx = signedTransaction; if (tx == "") { response.Result = "Error: No signed transaction provided."; MonitoringService.SendMessage("Empty tx " + userclaim.CoinShortName + " submitted.", "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId); return(Ok(response)); } Transaction t = null; try { t = Transaction.Parse(tx.Trim().Replace(" ", "")); } catch (Exception e) { response.Error = true; response.Result = "Error parsing transaction"; MonitoringService.SendMessage("Invalid tx " + userclaim.CoinShortName + " submitted " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); return(Ok(response)); } //BCX submit if (nodeService.Coin == "BCX") { } // Disable for now so that the full node is used (for segwit claims) if (false)//nodeService.Coin == "BTCP") { try { var client = new RestClient("https://explorer.btcprivate.org/api/"); var request = new RestRequest("tx/send/", Method.POST); request.AddJsonBody(new { rawtx = signedTransaction }); //request.AddParameter("rawtx", signedTransaction); IRestResponse restResponse = client.Execute(request); var content = restResponse.Content; // raw content as string //ViewBag.content = content; userclaim.TransactionHash = content; userclaim.WasTransmitted = true; userclaim.SubmitDate = DateTime.Now; db.SaveChanges(); MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcasting via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); response.Result = content; return(Ok(response)); } catch (Exception e) { MonitoringService.SendMessage("B2X explorer send failed", e.Message); } } if (nodeService.Coin == "BTG") { try { var client = new RestClient("https://explorer.bitcoingold.org/insight-api/"); var request = new RestRequest("tx/send/", Method.POST); request.AddJsonBody(new { rawtx = signedTransaction }); //request.AddParameter("rawtx", signedTransaction); IRestResponse restResponse = client.Execute(request); var content = restResponse.Content; // raw content as string //ViewBag.content = content; userclaim.TransactionHash = content; userclaim.WasTransmitted = true; userclaim.SubmitDate = DateTime.Now; db.SaveChanges(); MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcasting via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); response.Result = content; return(Ok(response)); } catch (Exception e) { MonitoringService.SendMessage(userclaim.CoinShortName + " explorer send failed", e.Message); } } if (nodeService.Coin == "BTX") { try { var client = new RestClient("http://insight.bitcore.cc/api/"); var request = new RestRequest("tx/send", Method.POST); request.AddJsonBody(new { rawtx = signedTransaction }); //request.AddParameter("rawtx", signedTransaction); IRestResponse restResponse = client.Execute(request); var content = restResponse.Content; // raw content as string //ViewBag.content = content; userclaim.TransactionHash = content; userclaim.WasTransmitted = true; userclaim.SubmitDate = DateTime.Now; db.SaveChanges(); MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcasting via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); response.Result = content; return(Ok(response)); } catch (Exception e) { MonitoringService.SendMessage(userclaim.CoinShortName + " explorer send failed", e.Message); } } if (nodeService.Coin == "B2X") { try { var client = new RestClient("https://explorer.b2x-segwit.io/b2x-insight-api/"); var request = new RestRequest("tx/send/", Method.POST); request.AddJsonBody(new { rawtx = signedTransaction }); //request.AddParameter("rawtx", signedTransaction); IRestResponse restResponse = client.Execute(request); var content = restResponse.Content; // raw content as string //ViewBag.content = content; userclaim.TransactionHash = content; userclaim.WasTransmitted = true; userclaim.SubmitDate = DateTime.Now; db.SaveChanges(); MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcasting via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); response.Result = content; return(Ok(response)); } catch (Exception e) { MonitoringService.SendMessage("B2X explorer send failed", e.Message); } } if (nodeService.Coin == "BTV") { //https://block.bitvote.one/tx/send ps://block.bitvote.one/insight-api/ try { var client = new RestClient("https://block.bitvote.one/insight-api/"); var request = new RestRequest("tx/send/", Method.POST); request.AddJsonBody(new { rawtx = signedTransaction }); //request.AddParameter("rawtx", signedTransaction); IRestResponse restResponse = client.Execute(request); var content = restResponse.Content; // raw content as string //ViewBag.content = content; userclaim.TransactionHash = content; userclaim.WasTransmitted = true; userclaim.SubmitDate = DateTime.Now; db.SaveChanges(); MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcasting via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); response.Result = content; return(Ok(response)); } catch (Exception e) { MonitoringService.SendMessage("BTV explorer send failed", e.Message); } } if (nodeService.Coin == "BTP") { try { var client = new RestClient("http://exp.btceasypay.com/insight-api/"); var request = new RestRequest("tx/send/", Method.POST); request.AddJsonBody(new { rawtx = signedTransaction }); //request.AddParameter("rawtx", signedTransaction); IRestResponse restResponse = client.Execute(request); var content = restResponse.Content; // raw content as string //ViewBag.content = content; userclaim.TransactionHash = content; userclaim.WasTransmitted = true; userclaim.SubmitDate = DateTime.Now; db.SaveChanges(); MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcasting via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); response.Result = content; return(Ok(response)); } catch (Exception e) { MonitoringService.SendMessage("BTV explorer send failed", e.Message); } //MonitoringService.SendMessage("New " + userclaim.CoinShortName + " begin broadcasting via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); //var bitpieClient = new RestClient //{ // BaseUrl = new Uri("https://bitpie.getcai.com/api/v1/") //}; //var txRequest = new RestRequest("/btp/broadcast", Method.POST); //string data = "{\"raw_tx\": \""+ userclaim.SignedTX + "\"}"; //txRequest.AddParameter("application/json; charset=utf-8", data, ParameterType.RequestBody); //txRequest.RequestFormat = DataFormat.Json; //try //{ // var txresponse = bitpieClient.Execute(txRequest); // if (txresponse.IsSuccessful) // { // if (txresponse.Content == "{\"result\": 0, \"error\": \"\"}") // { // response.Result = "Transaction was broadcast. Network reported unknown error. Double check signatures and ensure coins not already claimed."; // } // else if (txresponse.Content == "{\"result\": 0, \"error\": \"broadcast error\"}") // { // response.Result = "Transaction successfully broadcast. No known errors identified."; // } // else // { // response.Result = "Transaction successfully broadcast. Result code: " + txresponse.Content; // } // response.Txid = t.GetHash().ToString(); // } // else // { // response.Result = "Error sending transactoin. Node service unavailable."; // } // Debug.Print(txresponse.StatusDescription); // MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcast via explorer " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n " + signedTransaction); //} //catch (Exception e) //{ // MonitoringService.SendMessage("Tx server error", e.Message); // response.Result = "Transmission Error"; // return InternalServerError(); //} //return Ok(response); } //Regular nodes try { // If we don't have any connections, try to open them. if (nodeService.NumConnectedPeers < 1) { var seednodes = db.SeedNodes.Where(n => n.Coin == nodeService.Coin); nodeService.ConnectNodes(seednodes.Select(n => new NodeDetails() { coin = nodeService.Coin, ip = n.IP, port = n.Port, use = n.Enabled, }).ToList()); } string txid = t.GetHash().ToString(); response.Txid = txid; userclaim.TransactionHash = txid; db.SaveChanges(); var res = nodeService.BroadcastTransaction(t, false); if (res.IsError) { userclaim.WasTransmitted = false; userclaim.SignedTX = signedTransaction; MonitoringService.SendMessage("New " + userclaim.CoinShortName + " error broadcasting " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n txid: " + txid + "\r\nResult: " + res.Result); } else { userclaim.TransactionHash = txid; userclaim.WasTransmitted = true; userclaim.SignedTX = signedTransaction; MonitoringService.SendMessage("New " + userclaim.CoinShortName + " broadcasting " + Convert.ToString(userclaim.TotalValue), "Claim broadcast: https://www.coinpanic.com/Claim/ClaimConfirm?claimId=" + b.ClaimId + " " + " for " + userclaim.CoinShortName + "\r\n txid: " + txid + "\r\nResult: " + res.Result); } response.Result = res.Result; db.SaveChanges(); return(Ok(response)); } catch (Exception e) { MonitoringService.SendMessage("Tx server error", e.Message); return(InternalServerError()); } } }
public Result RequisitionAge_Method(IWebDriver WDriver, DataRow Requisition_Data, int a) { KeyWordMethods kwm = new KeyWordMethods(); ReadExcel ReadExcelHelper_local = new ReadExcel(); kwm._WDWait = kwm.WebDriver_Wait_Handler(WDriver, 60); CommonMethods objCommonMethods = new CommonMethods(); var results = new Result(); var Result_ScreenShot = new Result(); List <string> listExistClients = new List <string>() { }; List <string> str_list_SupplierMailId = new List <string>(); CreateRequirementRepository createRequirementRepository = new CreateRequirementRepository(); BroadcastModel broadcastModel = createRequirementRepository.GetBroadcastData(Requisition_Data); listExistClients = new List <string>() { Constants.Discover }; if (listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } listExistClients = new List <string>() { Constants.Discover }; if (!listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { //results.ErrorMessage1 = "Unable to click on the Main menu"; return(results); } } if (broadcastModel.strSubMenuLink.ToLower().Contains("identified")) { if (!kwm.waitForElementExists(WDriver, By.XPath("//table[@id='IdentifiedReqList']//tbody//tr"), kwm._WDWait)) { Thread.Sleep(2000); } } else { if (!kwm.waitForElementExists(WDriver, By.XPath("//table[@id='regReqList']//tbody//tr"), kwm._WDWait)) { Thread.Sleep(2000); } } //Search requirement kwm.sendText_XPath(WDriver, KeyWords.locator_XPath, KeyWords.XPath_SearchBox_Requirements_regReqList, broadcastModel.str_Link_ReqNumber, broadcastModel.str_Link_ReqNumber, false); //Wait for Requirement to load if (!kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_Img_Processing), kwm._WDWait)) { kwm.waitForElementToBeClickable(WDriver, By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); // /* only for test string RequisitionAge = kwm.ReqAge(WDriver, "Requisition Age")._Var; int Age = Int32.Parse(RequisitionAge); //Click on Requirement Link kwm.click(WDriver, KeyWords.locator_XPath, "//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"); //WDriver.FindElement(By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]")).Click(); //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); //Wait for broadcast link to be Displayed kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_Broadcast_reqBroadcast), kwm._WDWait); kwm.click(WDriver, KeyWords.locator_ID, KeyWords.ID_tabsAll); kwm.Action_LookInto_Element(WDriver, KeyWords.locator_XPath, KeyWords.Xpath_Date_ApprovalLog_CreateDate); //kwm.waitForElementToBeClickable(WDriver, By.XPath(KeyWords.Xpath_Date_ApprovalLog_CreateDate), kwm._WDWait); string Date = WDriver.FindElement(By.XPath("//*[@id='Table4']//tr[@class = 'altOdd skillrow odd']/td[1]")).Text; string[] date = Date.Split(' '); string CreatedDate = date[0]; DateTime myDate = DateTime.ParseExact(CreatedDate, "MM/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture); DateTime todaydate = DateTime.Now; int RequisitionAge_days = (todaydate.Date - myDate.Date).Days; if (Age == RequisitionAge_days) { } else { results.Result1 = KeyWords.Result_FAIL; return(results); } try { //kwm.waitForElementExists(WDriver, By.Id("tblSuppliers"), kwm._WDWait); //kwm.waitForElementToBeVisible(WDriver, By.Id("tblSuppliers"), kwm._WDWait); Thread.Sleep(10000); for (int t1 = 0; t1 < 100; t1++) { if (kwm.isElementDisplayed(WDriver, "tblSuppliers")) { Thread.Sleep(100); break; } } //Verify if the supplier table is displayed } catch (Exception e) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = e.Message; results.Result1 = KeyWords.Result_FAIL; return(results); } //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); if (!kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_OverlayLoader)) { kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); } kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails), kwm._WDWait); if (kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails)) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Broadcast is successfull"; results.listData = str_list_SupplierMailId; results.Result1 = KeyWords.Result_PASS; return(results); } return(results); //---------------------------------------------------------------------------------------- }
public Result Broadcast_Method(IWebDriver WDriver, DataRow Broadcast_Data, int a) { KeyWordMethods kwm = new KeyWordMethods(); ReadExcel ReadExcelHelper_local = new ReadExcel(); kwm._WDWait = kwm.WebDriver_Wait_Handler(WDriver, 60); CommonMethods objCommonMethods = new CommonMethods(); var results = new Result(); var Result_ScreenShot = new Result(); List <string> listExistClients = new List <string>() { }; List <string> str_list_SupplierMailId = new List <string>(); CreateRequirementRepository createRequirementRepository = new CreateRequirementRepository(); BroadcastModel broadcastModel = createRequirementRepository.GetBroadcastData(Broadcast_Data); BroadCastActions broadCastActions = new BroadCastActions(); listExistClients = new List <string>() { Constants.Discover }; if (listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp_Discover(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } listExistClients = new List <string>() { Constants.Discover }; if (!listExistClients.Contains(broadcastModel.strClientName.ToLower())) { results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Client_Change_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strClientName); if (results.Result1 == KeyWords.Result_FAIL) { Boolean bFlagDropDwon = false; try { // bFlagDropDwon = WDriver.FindElement(By.XPath(KeyWords.XPath_supplierMenu_ClientDropDown)).Enabled; bFlagDropDwon = kwm.isElementEnabledByXPath(WDriver, KeyWords.XPath_supplierMenu_ClientDropDown); } catch { bFlagDropDwon = false; } if (bFlagDropDwon) { return(results); } } } } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); results = kwm.Main_Sub_Menu_Click_NewApp(WDriver, KeyWords.locator_ID, KeyWords.ID_MainMenu, broadcastModel.strMainMenuLink, broadcastModel.strSubMenuLink); if (results.Result1 == KeyWords.Result_FAIL) { //results.ErrorMessage1 = "Unable to click on the Main menu"; return(results); } } // /* only for test if (!kwm.waitForElementExists(WDriver, By.XPath("//table[@id='regReqList']//tbody//tr"), kwm._WDWait)) { Thread.Sleep(2000); } //Search requirement kwm.sendText_XPath(WDriver, KeyWords.locator_XPath, KeyWords.XPath_SearchBox_Requirements_regReqList, broadcastModel.str_Link_ReqNumber, broadcastModel.str_Link_ReqNumber, false); Thread.Sleep(5000); //Wait for Requirement to load if (!kwm.waitForElementToBeVisible(WDriver, By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"), kwm._WDWait)) { kwm.waitForElementToBeClickable(WDriver, By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); Thread.Sleep(5000); //Click on Requirement Link kwm.click(WDriver, KeyWords.locator_XPath, "//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]"); //WDriver.FindElement(By.XPath("//table[@id='regReqList']//td/a[contains(text(),'" + broadcastModel.str_Link_ReqNumber + "')]")).Click(); //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); //Wait for broadcast link to be Displayed kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_Broadcast_reqBroadcast), kwm._WDWait); //Click on Broadcast menu link kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_ActionListMenu_Broadcast_reqBroadcast); //Wait for form to load Thread.Sleep(1000); if (kwm.isElementDisplayedByXPath(WDriver, "//div[@aria-labelledby='ui-dialog-title-PleaseWaitPopup' and contains(@style,'display: none')]")) { kwm.waitForElementToBeVisible(WDriver, By.XPath("//div[@aria-labelledby='ui-dialog-title-PleaseWaitPopup' and contains(@style,'display: none')]"), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //Click on Distribution List if (kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_li_DistributionList)) { kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_li_DistributionList); } //Wait for dialog box if (!kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_MsgBox_DistributionListPopup)) { kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_MsgBox_DistributionListPopup), kwm._WDWait); } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); listExistClients = new List <string>() { Constants.EQT }; if (listExistClients.Contains(broadcastModel.strClientName.ToLower())) { // Bill Rates(USD) * if (broadcastModel.str_txt_BillRatesUSD_ddlBillratesHigh != "") { kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_txt_BillRatesUSD_ddlBillratesHigh, broadcastModel.str_txt_BillRatesUSD_ddlBillratesHigh, false); if (results.Result1 == KeyWords.Result_FAIL) { kwm.sendText(WDriver, KeyWords.locator_ID, KeyWords.ID_txt_BillRatesUSD_ddlBillratesHigh, broadcastModel.str_txt_BillRatesUSD_ddlBillratesHigh, false); } } } //wait for distrubution dropdown list if (kwm.isElementDisplayed(WDriver, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList)) { //select the value by index in distrubution dropdown list //kwm.selectByIndex(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList, 1); if (broadcastModel.strClientName.ToLower() == Constants.Welchallyn || broadcastModel.strClientName.ToLower() == Constants.Tesla) { kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList, broadcastModel.str_Select_DistributionList); } else { //select the value by index in distrubution dropdown list kwm.selectByIndex(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_DistributionList_ddlDistList, 1); } //wait for tier dropdown to load kwm.waitForElementToBeVisible(WDriver, By.Id(KeyWords.ID_MsgBox_Select_Tiers_ddlTiers), kwm._WDWait); //select the value by index in distrubution dropdown list results = kwm.select(WDriver, KeyWords.locator_ID, KeyWords.ID_Select_ddlTiers, broadcastModel.str_Select_Tier); if (results.Result1 == KeyWords.Result_FAIL) { //select the value by index in distrubution dropdown list kwm.selectByIndex(WDriver, KeyWords.locator_ID, KeyWords.ID_MsgBox_Select_Tiers_ddlTiers, 1); } try { //kwm.waitForElementExists(WDriver, By.Id("tblSuppliers"), kwm._WDWait); //kwm.waitForElementToBeVisible(WDriver, By.Id("tblSuppliers"), kwm._WDWait); Thread.Sleep(4000); for (int t1 = 0; t1 < 100; t1++) { if (kwm.isElementDisplayed(WDriver, "tblSuppliers")) { Thread.Sleep(100); break; } } //Verify if the supplier table is displayed if (kwm.isElementDisplayedXpath(WDriver, "//*[@id='tblSuppliers_filter']/label/input")) { //Move to supplier list kwm.Action_LookInto_Element(WDriver, KeyWords.locator_ID, "tblSuppliers"); objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); // kwm.waitForElementToBeVisible(WDriver, By.XPath("//table[@id='tblSuppliers']//tr//th[@fieldname='primaryEmail']"), kwm._WDWait); //Verify Email Header is displayed if (kwm.isElementDisplayedByXPath(WDriver, "//table[@id='tblSuppliers']//tbody//tr[1]//input")) { // kwm.waitForElementToBeClickable(WDriver, By.XPath("//table[@id='tblSuppliers']//tr//th[@fieldname='primaryEmail']"), kwm._WDWait); //Need to check if the check box is selected or not //pending- end if (WDriver.FindElements(By.XPath("//table[@id='tblSuppliers']//tbody//tr")).ToList().Count > 0) { String setEmailXpath; //Get the attribute value of the email field String strVal = WDriver.FindElement(By.XPath("//table[@id='tblSuppliers']//tr//th[@fieldname='primaryEmail']")).GetAttribute("style"); //verifying if it is displayed on the screen load or not if (strVal.ToLower().Contains("display: none;")) { //setEmailXpath = "//table[@id='tblSuppliers']//tbody/tr//td[@id='iconTable']"; //foreach (IWebElement ele in WDriver.FindElements(By.XPath(setEmailXpath)).ToList()) //{ // ele.Click(); // // Actions action = new Actions(WDriver); // objCommonMethods.Action_Button_Enter(WDriver); // // action.SendKeys(Keys.Enter).Build().Perform(); // Thread.Sleep(1000); // //Add supplier mail id's to list // str_list_SupplierMailId.Add(kwm.GetText_Xpath(WDriver, "//table[@id='tblSuppliers']//tbody/tr/following-sibling::tr[@class='child']//span[normalize-space(text())='Email']/following-sibling::*[@class='dtr-data']")._Var); // // action.SendKeys(Keys.Enter).Build().Perform(); // objCommonMethods.Action_Button_Enter(WDriver); // Thread.Sleep(1000); // ele.Click(); //} kwm.jsCommand_Click(WDriver, "$('#tblSuppliers tbody tr td:first-child').click()"); setEmailXpath = "//table[@id='tblSuppliers']//tbody/tr[@class='child']//span[normalize-space(text())='Email']/following-sibling::*[@class='dtr-data' and contains(text(),'@hcmondemand.net')]"; //"//table[@id='tblSuppliers']//tbody/tr//td[@id='iconTable']"; foreach (IWebElement ele in WDriver.FindElements(By.XPath(setEmailXpath)).ToList()) { //Add supplier mail id's to list str_list_SupplierMailId.Add(ele.Text); } } else { setEmailXpath = "//table[@id='tblSuppliers']//tbody//tr[@role='row']//td//self::*[contains(text(),'@')]"; foreach (IWebElement ele in WDriver.FindElements(By.XPath(setEmailXpath)).ToList()) { //Add supplier mail id's to list str_list_SupplierMailId.Add(ele.Text); } } objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //click on broadcast button kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_Btn_Broadcast_Broadcast); if (kwm.waitForElementToBeClickable(WDriver, By.XPath(KeyWords.XPath_MsgBox_ConfirmSuppliers_Btn_Yes_Yes), kwm._WDWait)) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //click on yes button on confirm supplier popup kwm.jsClick(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_ConfirmSuppliers_Btn_Yes_Yes); kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK), kwm._WDWait); objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); //Click on Ok button results = kwm.click(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(5000); kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK), kwm._WDWait); kwm.click(WDriver, KeyWords.locator_XPath, KeyWords.XPath_MsgBox_dlgBroadcastSent_Btn_OK_OK); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Yes button is not displayed/clickable"; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "List count is 0 i.e no mail id's are added to the list"; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "No Mail's displayed for the selected suppliers"; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Supplier table is Not displayed "; results.Result1 = KeyWords.Result_FAIL; return(results); } } catch (Exception e) { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = e.Message; results.Result1 = KeyWords.Result_FAIL; return(results); } } else { objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Distribution Dropdown is not displayed/selected"; results.Result1 = KeyWords.Result_FAIL; return(results); } //wait for page to load kwm.waitForElementExists(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); if (!kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_OverlayLoader)) { kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_OverlayLoader), kwm._WDWait); } kwm.waitForElementToBeVisible(WDriver, By.XPath(KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails), kwm._WDWait); if (kwm.isElementDisplayedByXPath(WDriver, KeyWords.XPath_ActionListMenu_BroadcastDetails_reqBroadcastDetails)) { //broadCastActions.addComments(WDriver, Broadcast_Data, "TxtComment"); //broadCastActions.broadacastDetails(WDriver, Broadcast_Data); //broadCastActions.openDiscussion(WDriver, Broadcast_Data, "Gordon, James"); //broadCastActions.ReBroadcast_Method(WDriver, Broadcast_Data); //broadCastActions.saveAsCatalog(WDriver, Broadcast_Data); //broadCastActions.recallRequisition(WDriver, Broadcast_Data); //broadCastActions.requeueMethod(WDriver, Broadcast_Data, "Hemphill, Jeffrey", "Gordon, James"); //broadCastActions.cancelRequisition(WDriver, Broadcast_Data); //broadCastActions.changeStatus(WDriver, Broadcast_Data, "New"); //broadCastActions.reOpenRequistion(WDriver, Broadcast_Data); //broadCastActions.convertRequisitionToPayroll(WDriver, Broadcast_Data); //broadCastActions.assignMspPoc(WDriver, Broadcast_Data); //broadCastActions.sendReminder(WDriver, Broadcast_Data); //broadCastActions.viewETKDetails(WDriver, Broadcast_Data); objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); results.ErrorMessage = "Broadcast is successfull"; results.listData = str_list_SupplierMailId; results.Result1 = KeyWords.Result_PASS; return(results); } return(results); //---------------------------------------------------------------------------------------- //Edit method calling string strSubLevel = "./label"; objCommonMethods.SaveScreenShot_EachPage(WDriver, broadcastModel.strClientName + "_"); if (broadcastModel.str_Link_Edit != "") { results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, broadcastModel.str_Link_Edit, strSubLevel); if (results.Result1 == KeyWords.Result_FAIL) { Thread.Sleep(2000); results = kwm.list_Menu_Click(WDriver, KeyWords.locator_ID, KeyWords.ID_List_listMenu1, broadcastModel.str_Link_Edit, strSubLevel); if (results.Result1 == KeyWords.Result_FAIL) { return(results); } } } }
public CommonBarcodeReceiver(BroadcastModel broadcast) { this.broadcast = broadcast; }
protected override async Task PerformInternal(UserViewModel user, IEnumerable <string> arguments) { if (ChannelSession.Chat != null) { await ChannelSession.Chat.SendMessage("Sending clip creation request to Mixer..."); string clipName = await this.ReplaceStringWithSpecialModifiers(this.ClipName, user, arguments); if (!string.IsNullOrEmpty(clipName) && MixerClipsAction.MinimumLength <= this.ClipLength && this.ClipLength <= MixerClipsAction.MaximumLength) { bool clipCreated = false; DateTimeOffset clipCreationTime = DateTimeOffset.Now; BroadcastModel broadcast = await ChannelSession.Connection.GetCurrentBroadcast(); if (broadcast != null) { if (await ChannelSession.Connection.CanClipBeMade(broadcast)) { clipCreated = await ChannelSession.Connection.CreateClip(new ClipRequestModel() { broadcastId = broadcast.id.ToString(), highlightTitle = clipName, clipDurationInSeconds = this.ClipLength }); } } if (clipCreated) { for (int i = 0; i < 10; i++) { await Task.Delay(2000); IEnumerable <ClipModel> clips = await ChannelSession.Connection.GetChannelClips(ChannelSession.Channel); ClipModel clip = clips.OrderByDescending(c => c.uploadDate).FirstOrDefault(); if (clip != null && clip.uploadDate.ToLocalTime() >= clipCreationTime && clip.title.Equals(clipName)) { await ChannelSession.Chat.SendMessage("Clip Created: " + string.Format("https://mixer.com/{0}?clip={1}", ChannelSession.User.username, clip.shareableId)); if (this.DownloadClip && Directory.Exists(this.DownloadDirectory) && ChannelSession.Services.FileService.FileExists(MixerClipsAction.GetFFMPEGExecutablePath())) { ClipLocatorModel clipLocator = clip.contentLocators.FirstOrDefault(cl => cl.locatorType.Equals(VideoFileContentLocatorType)); if (clipLocator != null) { char[] invalidChars = Path.GetInvalidFileNameChars(); string fileName = new string(clipName.Select(c => invalidChars.Contains(c) ? '_' : c).ToArray()); string destinationFile = Path.Combine(this.DownloadDirectory, fileName + ".mp4"); Process process = new Process(); process.StartInfo.FileName = MixerClipsAction.GetFFMPEGExecutablePath(); process.StartInfo.Arguments = string.Format("-i {0} -c copy -bsf:a aac_adtstoasc \"{1}\"", clipLocator.uri, destinationFile); process.StartInfo.RedirectStandardOutput = true; process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; process.Start(); while (!process.HasExited) { await Task.Delay(500); } } } return; } } await ChannelSession.Chat.SendMessage("Clip was created, but could not be retrieved at this time"); } else { await ChannelSession.Chat.SendMessage("Unable to create clip, please try again later"); } } } }