public new Task <int> SendGroupMessageAsync(long groupNumber, params IMessageBase[] chain)
 {
     return(Task.Factory.StartNew <int>(msg => {
         IMessageBase data = msg as IMessageBase;
         Console.WriteLine("Group -> " + data.ToString());
         return 1;
     }, chain[0]));
 }
Esempio n. 2
0
        private static string GetCQMessage(IMessageBase msg)
        {
            switch (msg)
            {
            case FaceMessage face:
                return($"[mirai:face={face.Id}]");

            case PlainMessage plain:
                return(plain.Message.Encode());

            case JsonMessage json:
                return($"[mirai:json={json.Json.Encode()}]");

            case XmlMessage xml:
                return($"[mirai:xml={xml.Xml.Encode()}");

            case AtMessage at:
                return($"[mirai:at={at.Target}]");

            case ImageMessage img:
                return(img.ImageId != null ? $"[mirai:imageid={img.ImageId}]" : $"[mirai:imageurl={img.Url.Encode()}]");

            case AtAllMessage atall:
                return($"[mirai:atall=]");

            case PokeMessage poke:
                return($"[mirai:poke={poke.Name}]");

            case QuoteMessage quote:
                return("");

            case SourceMessage _:
                return("");

            default:
                return(msg.ToString().Encode());
            }
        }