chore: 后端方法注释

This commit is contained in:
CrescentLeaf
2026-01-17 00:59:11 +08:00
parent d35ce7a255
commit 200f5fd0aa
7 changed files with 97 additions and 3 deletions

View File

@@ -11,6 +11,10 @@ class GroupSettings {
this.settings = JSON.parse(chat.bean.settings)
}
/**
* 覆盖群组设定
* @param bean 要覆盖的设定, 不需要覆盖的不需要填入
*/
update(bean: GroupSettingsBean) {
const updateValue = (key: string) => {
if (key in bean)
@@ -26,6 +30,9 @@ class GroupSettings {
this.apply()
}
/**
* 应用更改
*/
apply() {
this.chat.setAttr('settings', JSON.stringify(this.settings))
}
@@ -36,10 +43,19 @@ export default class ChatGroup extends Chat {
return new GroupSettings(this)
}
/**
* 确保是群组类型后, 转换成群组对话
* 唯一的作用可能是修改群组设定
* @param chat
*/
static fromChat(chat: Chat) {
return new ChatGroup(chat.bean)
}
/**
* 创建新的群组
* @param group_name 群组名称
*/
static createGroup(group_name?: string) {
return this.create(group_name, 'group')
}