AutoModerationRuleManager

export class AutoModerationRuleManager extends CachedManager<Snowflake, AutoModerationRule, AutoModerationRuleResolvable>
export class AutoModerationRuleManager extends CachedManager<Snowflake, AutoModerationRule, AutoModerationRuleResolvable>
Manages API methods for auto moderation rules and stores their cache.
Readonly
cache:Collection<Key, Holds>
The cache of items for this manager.
Inherited from DataManager
Readonly
client:Client
The client that instantiated this Manager
Inherited from BaseManager
guild:Guild
The guild this manager belongs to.
Readonly
holds:Constructable<Holds>
The data structure belonging to this manager.
Inherited from DataManager
create(options):Promise<AutoModerationRule>
Creates a new auto moderation rule.
NameTypeOptionalDescription
optionsAutoModerationRuleCreateOptionsNoOptions for creating the auto moderation rule
delete(autoModerationRule, reason?):Promise<void>
Deletes an auto moderation rule.
NameTypeOptionalDescription
autoModerationRuleAutoModerationRuleResolvableNoThe auto moderation rule to delete
reasonstringYesThe reason for deleting the auto moderation rule
edit(autoModerationRule, options):Promise<AutoModerationRule>
Edits an auto moderation rule.
NameTypeOptionalDescription
autoModerationRuleAutoModerationRuleResolvableNoThe auto moderation rule to edit
optionsAutoModerationRuleEditOptionsNoOptions for editing the auto moderation rule
fetch(options):Promise<AutoModerationRule>
Fetches auto moderation rules from Discord.
Example
// Fetch all auto moderation rules from a guild without caching
guild.autoModerationRules.fetch({ cache: false })
.then(console.log)
.catch(console.error);
// Fetch all auto moderation rules from a guild without caching
guild.autoModerationRules.fetch({ cache: false })
.then(console.log)
.catch(console.error);
Example
// Fetch a single auto moderation rule
guild.autoModerationRules.fetch('979083472868098119')
.then(console.log)
.catch(console.error);
// Fetch a single auto moderation rule
guild.autoModerationRules.fetch('979083472868098119')
.then(console.log)
.catch(console.error);
Example
// Fetch a single auto moderation rule without checking cache and without caching
guild.autoModerationRules.fetch({ autoModerationRule: '979083472868098119', cache: false, force: true })
.then(console.log)
.catch(console.error)
// Fetch a single auto moderation rule without checking cache and without caching
guild.autoModerationRules.fetch({ autoModerationRule: '979083472868098119', cache: false, force: true })
.then(console.log)
.catch(console.error)
NameTypeOptionalDescription
optionsAutoModerationRuleResolvable | FetchAutoModerationRuleOptionsNoOptions for fetching auto moderation rule(s)
resolve(autoModerationRule):AutoModerationRule | null
NameTypeOptionalDescription
autoModerationRuleAutoModerationRuleResolvableNoThe AutoModerationRule resolvable to resolve
resolveId(autoModerationRule):Snowflake | null
NameTypeOptionalDescription
autoModerationRuleAutoModerationRuleResolvableNoThe AutoModerationRule resolvable to resolve
valueOf():Collection<Key, Holds>