Home Manual Reference Source Repository
import AllowedChannelStorage from 'discord-graf/src/storage/allowed-channels.js'
public class | source

AllowedChannelStorage

Extends:

src/storage/..js~GuildStorage → AllowedChannelStorage

Stores channels that the bot is allowed to operate in within a guild

Constructor Summary

Public Constructor
public

constructor(localStorage: LocalStorage, logger: Logger)

Method Summary

Public Methods
public

delete(channel: Channel): boolean

Deletes a channel from the storage

public

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

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

public

save(channel: Channel): boolean

Saves a channel 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(channel: Channel): boolean source

Deletes a channel from the storage

Params:

NameTypeAttributeDescription
channel Channel

The channel to delete

Return:

boolean

Whether or not the channel was deleted

See:

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

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

Params:

NameTypeAttributeDescription
guild Guild | string

The guild or guild ID to find the channels of

searchString string
  • optional

The string to match channels against

Return:

Channel[]

All found channels

See:

public save(channel: Channel): boolean source

Saves a channel to the storage

Params:

NameTypeAttributeDescription
channel Channel

The channel to save

Return:

boolean

Whether or not the channel was saved

See: