Example #1
0
 /// <summary>
 /// 回复组消息
 /// </summary>
 /// <param name="message"></param>
 /// <returns></returns>
 public Task <int> ReplyGroup(string message)
 {
     if (GroupInfo != null)
     {
         return(Mirai.SendGroupMessageAsync(GroupInfo.Id, message.ToMessage()));
     }
     else
     {
         return(null);
     }
 }
Example #2
0
 /// <summary>
 /// 回复个人消息
 /// </summary>
 /// <param name="message"></param>
 /// <returns></returns>
 public Task <int> ReplyTemp(string message)
 {
     if (Sender != null && GroupInfo != null)
     {
         return(Mirai.SendTempMessageAsync(Sender.Id, GroupInfo.Id, message.ToMessage()));
     }
     else
     {
         return(null);
     }
 }
Example #3
0
 /// <summary>
 /// 回复个人消息
 /// </summary>
 /// <param name="message"></param>
 /// <returns></returns>
 public Task <int> Reply(string message)
 {
     if (Sender != null)
     {
         return(Mirai.SendFriendMessageAsync(GroupInfo.Id, message.ToMessage()));
     }
     else
     {
         return(null);
     }
 }
Example #4
0
        /// <summary>
        /// 回复组消息
        /// </summary>
        /// <param name="urls"></param>
        /// <returns></returns>
        public async Task <int> ReplyGroupImg(Stream imageStream)
        {
            //MessageChain
            ImageMessage message = await Mirai.UploadPictureAsync(UploadTarget.Group, imageStream);

            //ImageMessage message = new ImageMessage(null, null, "data/net.mamoe.mirai-api-http/images/80245079ab39489f993f31b0a2b85676.jpeg");
            //message.Path = null;
            //message.ImageId = message.ImageId.Replace("jpeg", "mirai").Replace("jpg", "mirai");
            imageStream.Dispose();
            if (GroupInfo != null)
            {
                return(await Mirai.SendGroupMessageAsync(GroupInfo.Id, message));
            }
            else
            {
                return(0);
            }
        }
Example #5
0
 /// <summary>
 /// 发送临时消息
 /// </summary>
 /// <param name="message"></param>
 /// <param name="id"></param>
 /// <returns></returns>
 public Task <int> SendTemp(string message, long id)
 {
     return(Mirai.SendTempMessageAsync(id, GroupInfo.Id, message.ToMessage()));
 }