Ejemplo n.º 1
0
        public string Format(MessageChain chain)
        {
            return(string.Join(string.Empty, chain.Where(x => x.GetType().GetCustomAttribute <SerializableAttribute>() != null).Select(x => PlainSelector(x))));

            string PlainSelector(MessageComponent comp)
            {
                return(comp switch
                {
                    Plain it => it.Text,
                    _ => $"[hyper.{comp.TypeName.ToLower()}({CodeSelector(comp)})]"
                });
            }