Table of Contents

Class RestGuildExperimentalExtensions

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

提供对 RestGuild 的实验性方法。

public static class RestGuildExperimentalExtensions
Inheritance
RestGuildExperimentalExtensions
Inherited Members

Methods

CreateBehaviorRestrictionAsync(RestGuild, string, IReadOnlyCollection<IBehaviorRestrictionCondition>, TimeSpan, BehaviorRestrictionType, bool, RequestOptions?)

创建服务器行为限制。

public static Task<RestBehaviorRestriction> CreateBehaviorRestrictionAsync(this RestGuild guild, string name, IReadOnlyCollection<IBehaviorRestrictionCondition> conditions, TimeSpan duration, BehaviorRestrictionType restrictionType, bool isEnabled = true, RequestOptions? options = null)

Parameters

guild RestGuild

要创建行为限制的服务器。

name string

行为限制名称。

conditions IReadOnlyCollection<IBehaviorRestrictionCondition>

行为限制条件集合。

duration TimeSpan

行为限制持续时间。

restrictionType BehaviorRestrictionType

行为限制类型。

isEnabled bool

是否启用行为限制。

options RequestOptions

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

Returns

Task<RestBehaviorRestriction>

一个表示异步操作的任务,任务的结果是创建的行为限制。

Exceptions

NotSupportedException

guild 不是 RestGuildSocketGuild 时引发。

CreateContentFilterAsync(RestGuild, IContentFilterTarget, IReadOnlyCollection<IContentFilterHandler>?, IReadOnlyCollection<ContentFilterExemption>?, bool, RequestOptions?)

创建服务器内容过滤。

public static Task<RestContentFilter> CreateContentFilterAsync(this RestGuild guild, IContentFilterTarget target, IReadOnlyCollection<IContentFilterHandler>? handlers = null, IReadOnlyCollection<ContentFilterExemption>? exemptions = null, bool isEnabled = true, RequestOptions? options = null)

Parameters

guild RestGuild

要创建内容过滤的服务器。

target IContentFilterTarget

内容过滤目标。

handlers IReadOnlyCollection<IContentFilterHandler>

内容过滤处理程序集合。

exemptions IReadOnlyCollection<ContentFilterExemption>

内容过滤豁免集合。

isEnabled bool

是否启用内容过滤。

options RequestOptions

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

Returns

Task<RestContentFilter>

一个表示异步操作的任务,任务的结果是创建的内容过滤。

Exceptions

NotSupportedException

guild 不是 RestGuildSocketGuild 时引发。

GetBehaviorRestrictionsAsync(RestGuild, RequestOptions?)

获取服务器的行为限制信息。

public static Task<IReadOnlyCollection<RestBehaviorRestriction>> GetBehaviorRestrictionsAsync(this RestGuild guild, RequestOptions? options = null)

Parameters

guild RestGuild

要获取行为限制信息的服务器。

options RequestOptions

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

Returns

Task<IReadOnlyCollection<RestBehaviorRestriction>>

一个表示异步操作的任务,任务的结果是服务器的所有行为限制信息。

Exceptions

NotSupportedException

guild 不是 RestGuildSocketGuild 时引发。

GetContentFiltersAsync(RestGuild, RequestOptions?)

获取服务器的内容过滤信息。

public static Task<IReadOnlyCollection<RestContentFilter>> GetContentFiltersAsync(this RestGuild guild, RequestOptions? options = null)

Parameters

guild RestGuild

要获取内容过滤信息的服务器。

options RequestOptions

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

Returns

Task<IReadOnlyCollection<RestContentFilter>>

一个表示异步操作的任务,任务的结果是服务器的所有内容过滤信息。

Exceptions

NotSupportedException

guild 不是 RestGuildSocketGuild 时引发。