示例#1
0
        public async Task MulticastMessage(IEnumerable <string> to, ILineMessage message)
        {
            if (to == null)
            {
                throw new ArgumentNullException(nameof(to));
            }

            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            var toCount = to.Count();

            if (toCount == 0 || toCount > 150)
            {
                throw new ArgumentException($"{nameof(to)} is required and max length is 150.");
            }

            await Post(LineMessageMulticastApiPath, new LineMulticastMessage
            {
                To       = to,
                Messages = new List <ILineMessage> {
                    message
                }
            });
        }
示例#2
0
        public async Task PushMessage(string to, ILineMessage message)
        {
            if (to == null)
            {
                throw new ArgumentNullException(nameof(to));
            }

            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            await Post(LineMessagePushApiPath, new LinePushMessage
            {
                To       = to,
                Messages = new List <ILineMessage> {
                    message
                }
            });
        }
示例#3
0
 public Task PushMessageAsync(ILineMessage lineMessage, LineChatRoomInfo chatRoomInfo)
 {
     throw new System.NotImplementedException();
 }
示例#4
0
 public Task PushMessageAsync(ILineMessage lineMessage, LineUserInfo userInfo)
 {
     throw new System.NotImplementedException();
 }
 public async Task PushMessageAsync(ILineMessage lineMessage, LineUserInfo userInfo)
 {
     StringContent stringContent = lineMessage.GenerateStringContent();
 }