Home Manual Reference Source Repository
import ModRoleStorage from 'discord-graf/src/storage/mod-roles.js'
public class | source

ModRoleStorage

Extends:

src/storage/..js~GuildStorage → ModRoleStorage

Stores roles that are moderators within a guild

Constructor Summary

Public Constructor
public

constructor(localStorage: LocalStorage, logger: Logger)

Method Summary

Public Methods
public

delete(role: Role): boolean

Deletes a role from the storage

public

find(guild: Guild | string, searchString: string): Role[]

Finds all roles associated with a guild that optionally match a search string

public

save(role: Role): boolean

Saves a role to the storage

Public Constructors

public constructor(localStorage: LocalStorage, logger: Logger) source

Params:

NameTypeAttributeDescription
localStorage LocalStorage

The LocalStorage instance to use

logger Logger
  • optional

The logger to use

Public Methods

public delete(role: Role): boolean source

Deletes a role from the storage

Params:

NameTypeAttributeDescription
role Role

The role to delete

Return:

boolean

Whether or not the role was deleted

See:

public find(guild: Guild | string, searchString: string): Role[] source

Finds all roles associated with a guild that optionally match a search string

Params:

NameTypeAttributeDescription
guild Guild | string

The guild or guild ID to find the roles of

searchString string
  • optional

The string to match roles against

Return:

Role[]

All found roles

See:

public save(role: Role): boolean source

Saves a role to the storage

Params:

NameTypeAttributeDescription
role Role

The role to save

Return:

boolean

Whether or not the role was saved

See: