示例#1
0
 /// <summary>
 /// Recalls a sent message.
 /// </summary>
 /// <param name="message">The message to recall.</param>
 /// <returns></returns>
 public async Task RecallMessage(LCIMMessage message)
 {
     if (message == null)
     {
         throw new ArgumentNullException(nameof(message));
     }
     await Client.MessageController.RecallMessage(Id, message);
 }
示例#2
0
 /// <summary>
 /// Updates a sent message.
 /// </summary>
 /// <param name="oldMessage">The message to update.</param>
 /// <param name="newMessage">The updated message.</param>
 /// <returns></returns>
 public async Task UpdateMessage(LCIMMessage oldMessage, LCIMMessage newMessage)
 {
     if (oldMessage == null)
     {
         throw new ArgumentNullException(nameof(oldMessage));
     }
     if (newMessage == null)
     {
         throw new ArgumentNullException(nameof(newMessage));
     }
     await Client.MessageController.UpdateMessage(Id, oldMessage, newMessage);
 }
示例#3
0
        /// <summary>
        /// Sends a message in this conversation.
        /// </summary>
        /// <param name="message">The message to send.</param>
        /// <param name="options">The options of sending message.</param>
        /// <returns></returns>
        public async Task <LCIMMessage> Send(LCIMMessage message,
                                             LCIMMessageSendOptions options = null)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }
            if (options == null)
            {
                options = LCIMMessageSendOptions.Default;
            }
            await message.PrepareSend();

            await Client.MessageController.Send(Id, message, options);

            LastMessage = message;
            return(message);
        }