Class RestGuildExperimentalExtensions
提供对 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
guildRestGuild要创建行为限制的服务器。
namestring行为限制名称。
conditionsIReadOnlyCollection<IBehaviorRestrictionCondition>行为限制条件集合。
durationTimeSpan行为限制持续时间。
restrictionTypeBehaviorRestrictionType行为限制类型。
isEnabledbool是否启用行为限制。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<RestBehaviorRestriction>
一个表示异步操作的任务,任务的结果是创建的行为限制。
Exceptions
- NotSupportedException
当
guild不是 RestGuild 或 SocketGuild 时引发。
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
guildRestGuild要创建内容过滤的服务器。
targetIContentFilterTarget内容过滤目标。
handlersIReadOnlyCollection<IContentFilterHandler>内容过滤处理程序集合。
exemptionsIReadOnlyCollection<ContentFilterExemption>内容过滤豁免集合。
isEnabledbool是否启用内容过滤。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<RestContentFilter>
一个表示异步操作的任务,任务的结果是创建的内容过滤。
Exceptions
- NotSupportedException
当
guild不是 RestGuild 或 SocketGuild 时引发。
GetBehaviorRestrictionsAsync(RestGuild, RequestOptions?)
获取服务器的行为限制信息。
public static Task<IReadOnlyCollection<RestBehaviorRestriction>> GetBehaviorRestrictionsAsync(this RestGuild guild, RequestOptions? options = null)
Parameters
guildRestGuild要获取行为限制信息的服务器。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<IReadOnlyCollection<RestBehaviorRestriction>>
一个表示异步操作的任务,任务的结果是服务器的所有行为限制信息。
Exceptions
- NotSupportedException
当
guild不是 RestGuild 或 SocketGuild 时引发。
GetContentFiltersAsync(RestGuild, RequestOptions?)
获取服务器的内容过滤信息。
public static Task<IReadOnlyCollection<RestContentFilter>> GetContentFiltersAsync(this RestGuild guild, RequestOptions? options = null)
Parameters
guildRestGuild要获取内容过滤信息的服务器。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<IReadOnlyCollection<RestContentFilter>>
一个表示异步操作的任务,任务的结果是服务器的所有内容过滤信息。
Exceptions
- NotSupportedException
当
guild不是 RestGuild 或 SocketGuild 时引发。