Пример #1
0
        /// <summary>
        /// Creates a rich menu.
        /// </summary>
        /// <param name="richMenu"></param>
        /// <returns></returns>
        public async Task <LineClientResult <RichMenuIdResponse> > Create(RichMenu richMenu)
        {
            if (richMenu == null)
            {
                throw new ArgumentNullException(nameof(RichMenu));
            }

            var request = new LinePostRequest <RichMenuIdResponse>(this, $"bot/richmenu");

            return(await request.Execute(richMenu));
        }
Пример #2
0
        /// <summary>
        /// Send message to multiple
        /// </summary>
        /// <param name="multiCastMessageRequest"></param>
        /// <returns></returns>
        public async Task <LineClientResult <ResponseItem> > MulticastMessage(MultiCastMessageRequest multiCastMessageRequest)
        {
            if (multiCastMessageRequest == null)
            {
                throw new ArgumentNullException(nameof(MultiCastMessageRequest));
            }

            var request = new LinePostRequest <ResponseItem>(this, "bot/message/multicast");

            return(await request.Execute(multiCastMessageRequest));
        }
Пример #3
0
        /// <summary>
        /// Leave group
        /// </summary>
        /// <param name="groupId"></param>
        /// <returns></returns>
        public async Task <LineClientResult <ResponseItem> > Leave(string groupId)
        {
            if (string.IsNullOrEmpty(groupId))
            {
                throw new ArgumentException("The property group iden can't not be null");
            }

            var request = new LinePostRequest <ResponseItem>(this, $"bot/group/{groupId}/leave");

            return(await request.Execute(null));
        }
Пример #4
0
        /// <summary>
        /// Reply message
        /// </summary>
        /// <param name="replyMessageRequest"></param>
        /// <returns></returns>
        public async Task <LineClientResult <ResponseItem> > ReplyMessage(ReplyMessageRequest replyMessageRequest)
        {
            if (replyMessageRequest == null)
            {
                throw new ArgumentNullException(nameof(ReplyMessageRequest));
            }

            var request = new LinePostRequest <ResponseItem>(this, "bot/message/reply");

            return(await request.Execute(replyMessageRequest));
        }
Пример #5
0
        /// <summary>
        /// Links a rich menu to a user. Only one rich menu can be linked to a user at one time.
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="richMenuId"></param>
        /// <returns></returns>
        public async Task <LineClientResult <ResponseItem> > LinkRichMenuWithUser(string userId, string richMenuId)
        {
            if (string.IsNullOrEmpty(userId))
            {
                throw new ArgumentException("The property user iden can't not be null");
            }

            if (string.IsNullOrEmpty(richMenuId))
            {
                throw new ArgumentException("The property rich menu iden can't not be null");
            }

            var request = new LinePostRequest <ResponseItem>(this, $"bot/user/{userId}/richmenu/{richMenuId}");

            return(await request.Execute(null));
        }