Zhamao Framework 3.2.4
A high-performance chatbot + web framework
载入中...
搜索中...
未找到
CatCode类 参考

静态 Public 成员函数

static fromSegment (string|array|MessageSegment $message_segment, bool $encode_text=false)
 
static encode (\Stringable|int|string $msg, bool $is_param=false)
 
static decode (\Stringable|int|string $msg, bool $is_param=false)
 

成员函数说明

◆ decode()

static decode ( \Stringable|int|string  $msg,
bool  $is_param = false 
)
static

反转义字符串中的CatCode敏感符号

参数
int | string | \Stringable$msg字符串
bool$is_param如果是解码CatCode本体内容,则为false(默认),如果是参数内的字符串,则为true
返回
string 转义后的CatCode

◆ encode()

static encode ( \Stringable|int|string  $msg,
bool  $is_param = false 
)
static

转义CatCode的特殊字符

参数
int | string | \Stringable$msg字符串
bool$is_param如果是转义CatCode本体内容,则为false(默认),如果是参数内的字符串,则为true
返回
string 转义后的CatCode

◆ fromSegment()

static fromSegment ( string|array|MessageSegment  $message_segment,
bool  $encode_text = false 
)
static

从 MessageSegment 转换为 CatCode 字符串

参数
array | MessageSegment | string$message_segmentMessageSegment 对象或数组
bool$encode_text是否对文本进行 CatCode 编码(默认为否)

该类的文档由以下文件生成: