Search Results for

    Show / Hide Table of Contents

    Class Element

    消息元素,即cqhttp所定义的消息段

    Inheritance
    System.Object
    Element
    BaseElementShare
    ElementFile
    ElementAnnonymous
    ElementAt
    ElementContact
    ElementEmoji
    ElementFace
    ElementForward
    ElementForward.ElementNode
    ElementLocation
    ElementMusic
    ElementReply
    ElementShake
    ElementText
    Namespace: cqhttp.Cyan.Messages.CQElements.Base
    Assembly: cqhttp.Cyan.dll
    Syntax
    public class Element : object
    Remarks

    should NEVER be constructed or used directly

    Constructors

    | Improve this Doc View Source

    Element(String, Dictionary<String, String>)

    构造消息段,一般不会手动调用

    Declaration
    public Element(string type, Dictionary<string, string> dict)
    Parameters
    Type Name Description
    System.String type

    消息段类型

    Dictionary<System.String, System.String> dict

    消息段键值对

    | Improve this Doc View Source

    Element(String, (String key, String value)[])

    手动构造一个消息段,一般用不到

    Declaration
    public Element(string type, params (string key, string value)[] dict)
    Parameters
    Type Name Description
    System.String type

    消息段类型

    System.ValueTuple<System.String, System.String>[] dict

    手动输入的键值对

    Fields

    | Improve this Doc View Source

    isSingle

    表示消息段是否只能单独发送

    Declaration
    public bool isSingle
    Field Value
    Type Description
    System.Boolean

    Properties

    | Improve this Doc View Source

    data

    represents the true message

    Declaration
    public virtual Dictionary<string, string> data { get; }
    Property Value
    Type Description
    Dictionary<System.String, System.String>
    | Improve this Doc View Source

    type

    消息段类型

    Declaration
    public string type { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object b)
    Parameters
    Type Name Description
    System.Object b
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetElement(String, Dictionary<String, String>)

    构造一个类型为type的消息段

    Declaration
    public static Element GetElement(string type, Dictionary<string, string> dict)
    Parameters
    Type Name Description
    System.String type
    Dictionary<System.String, System.String> dict
    Returns
    Type Description
    Element
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    ToString()

    将消息段序列化为CQ码格式,即酷Q原生消息格式 https://d.cqp.me/Pro/CQ码

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    CQCode

    Operators

    | Improve this Doc View Source

    Addition(Element, Element)

    Declaration
    public static Message operator +(Element a, Element b)
    Parameters
    Type Name Description
    Element a
    Element b
    Returns
    Type Description
    Message
    | Improve this Doc View Source

    Equality(Element, Element)

    Declaration
    public static bool operator ==(Element a, Element b)
    Parameters
    Type Name Description
    Element a
    Element b
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Inequality(Element, Element)

    Declaration
    public static bool operator !=(Element a, Element b)
    Parameters
    Type Name Description
    Element a
    Element b
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    ☀
    ☾