Class RestMessageTemplate
表示一个基于 REST 的消息模板。
public class RestMessageTemplate : RestEntity<ulong>, IMessageTemplate, IEntity<ulong>, IUpdateable
- Inheritance
-
RestMessageTemplate
- Implements
- Inherited Members
Properties
AuditStatus
获取消息模板的审核状态。
public TemplateAuditStatus AuditStatus { get; }
Property Value
Content
获取消息模板的内容。
public string Content { get; }
Property Value
MessageType
获取消息模板的消息类型。
public TemplateMessageType MessageType { get; }
Property Value
TestChannelId
获取消息模板的测试频道 ID。
public ulong? TestChannelId { get; }
Property Value
TestData
获取消息模板的测试数据。
public JsonElement? TestData { get; }
Property Value
Title
获取消息模板的标题。
public string Title { get; }
Property Value
Type
获取消息模板的类型。
public TemplateType Type { get; }
Property Value
Methods
DeleteAsync(RequestOptions?)
删除此模板
public Task DeleteAsync(RequestOptions? options = null)
Parameters
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步删除操作的任务。
ModifyAsync(Action<MessageTemplateProperties>, RequestOptions?)
修改此模板
public Task ModifyAsync(Action<MessageTemplateProperties> func, RequestOptions? options = null)
Parameters
func
Action<MessageTemplateProperties>一个包含修改模板属性的委托。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步修改操作的任务。
- See Also
UpdateAsync(RequestOptions?)
通过 REST API 获取此实体对象的最新状态,并替换当前对象的属性。
public Task UpdateAsync(RequestOptions? options = null)
Parameters
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步更新操作的任务。
Remarks
warning
此方法将从 KOOK REST API 获取最新数据,并替换当前对象的属性,而非使用指定的属性修改 KOOK 服务端的数据。