Table of Contents

Class RestBehaviorRestriction

Namespace
Kook.Rest
Assembly
Kook.Net.Experimental.dll

表示一个基于 REST 的服务器行为限制。

public class RestBehaviorRestriction : RestEntity<string>, IBehaviorRestriction, IEntity<string>, IDeletable
Inheritance
RestBehaviorRestriction
Implements
Inherited Members

Properties

Conditions

获取限制条件类型。

public IReadOnlyCollection<IBehaviorRestrictionCondition> Conditions { get; }

Property Value

IReadOnlyCollection<IBehaviorRestrictionCondition>

CreatedAt

获取规则创建的时间。

public DateTimeOffset CreatedAt { get; }

Property Value

DateTimeOffset

Duration

获取限制持续时长。

public TimeSpan Duration { get; }

Property Value

TimeSpan

GuildId

获取此行为限制所属的服务器的 ID。

public ulong GuildId { get; }

Property Value

ulong

IsEnabled

获取此行为限制是否启用。

public bool IsEnabled { get; }

Property Value

bool

Name

获取此限制的名称。

public string Name { get; }

Property Value

string

Type

获取限制的行为类型。

public BehaviorRestrictionType Type { get; }

Property Value

BehaviorRestrictionType

UpdatedAt

获取规则更新的时间。

public DateTimeOffset UpdatedAt { get; }

Property Value

DateTimeOffset

Methods

DeleteAsync(RequestOptions?)

删除此实体对象及其所有子实体对象。

public Task DeleteAsync(RequestOptions? options = null)

Parameters

options RequestOptions

发送请求时要使用的选项。

Returns

Task

DisableAsync(RequestOptions?)

禁用此行为限制。

public Task DisableAsync(RequestOptions? options = null)

Parameters

options RequestOptions

发送请求时要使用的选项。

Returns

Task

一个表示异步修改操作的任务。

EnableAsync(RequestOptions?)

启用此行为限制。

public Task EnableAsync(RequestOptions? options = null)

Parameters

options RequestOptions

发送请求时要使用的选项。

Returns

Task

一个表示异步修改操作的任务。

ModifyAsync(Action<ModifyBehaviorRestrictionProperties>, RequestOptions?)

修改服务器的行为限制信息。

public Task ModifyAsync(Action<ModifyBehaviorRestrictionProperties> func, RequestOptions? options = null)

Parameters

func Action<ModifyBehaviorRestrictionProperties>

用于修改行为限制属性的委托。

options RequestOptions

发送请求时要使用的选项。

Returns

Task

一个表示异步修改操作的任务。