/// <summary> /// 收到 "廣播訊息數" 後會回覆的文字 /// </summary> /// <param name="receiveText">接收到的訊息</param> /// <returns></returns> private async Task <string> GetNumberOfSentBroadcastMessagesTips(string receiveText) { string result = ""; NumberOfSentBroadcastMessagesResponseModel responseModel = new NumberOfSentBroadcastMessagesResponseModel(); int position = receiveText.IndexOf("."); string date = null; if (position != -1) { date = receiveText.Substring(position + 1); } else { date = DateTime.Now.ToString("yyyyMMdd"); result = @"輸入的格式有誤。 請輸入「廣播訊息數.yyyyMMdd」 例如:廣播訊息數.20200101"; return(result); } responseModel = await _lineClient.GetNumberOfSentBroadcastMessagesAsync(date); switch (responseModel.status) { case NumberOfSentBroadcastMessagesStatus.ready: result = $"{date} 使用broadcast廣播訊息的數量為 : {responseModel.success}"; break; case NumberOfSentBroadcastMessagesStatus.unready: result = "該日的資料尚未統計完成"; break; case NumberOfSentBroadcastMessagesStatus.out_of_service: result = "日期格式有誤"; break; default: result = "發生異常,暫時無法查詢"; break; } return(result); }