Class: PatternCommandStore
@sapphire/plugin-pattern-commands.PatternCommandStore
Hierarchy
-
AliasStore
<PatternCommand
>↳
PatternCommandStore
Constructors
constructor
• new PatternCommandStore(): PatternCommandStore
Returns
Overrides
AliasStore<PatternCommand>.constructor
Defined in
projects/plugins/packages/pattern-commands/src/lib/structures/PatternCommandStore.ts:5
Properties
#private
• Private
#private: any
Inherited from
AliasStore.#private
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:461
Constructor
• Readonly
Constructor: AbstractConstructor
<PatternCommand
>
Inherited from
AliasStore.Constructor
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:462
[toStringTag]
• Readonly
[toStringTag]: string
Inherited from
AliasStore.[toStringTag]
Defined in
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137
aliases
• Readonly
aliases: Collection
<string
, PatternCommand
>
The aliases referencing to pieces.
Inherited from
AliasStore.aliases
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:901
constructor
• constructor: CollectionConstructor
Inherited from
AliasStore.constructor
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:21
name
• Readonly
name: keyof StoreRegistryEntries
Inherited from
AliasStore.name
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:463
paths
• Readonly
paths: Set
<string
>
Inherited from
AliasStore.paths
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:464
size
• Readonly
size: number
Inherited from
AliasStore.size
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:45
strategy
• Readonly
strategy: ILoaderStrategy
<PatternCommand
>
Inherited from
AliasStore.strategy
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:465
[species]
▪ Static
Readonly
[species]: MapConstructor
Inherited from
AliasStore.[species]
Defined in
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:319
defaultStrategy
▪ Static
defaultStrategy: ILoaderStrategy
<any
>
The default strategy, defaults to LoaderStrategy, which is constructed on demand when a store is constructed, when none was set beforehand.
Inherited from
AliasStore.defaultStrategy
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:584
logger
▪ Static
logger: null
| StoreLogger
The default logger, defaults to null
.
Inherited from
AliasStore.logger
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:588
Accessors
container
• get
container(): Container
A reference to the Container object for ease of use.
Returns
Container
See
container
Inherited from
AliasStore.container
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:479
Methods
[iterator]
▸ [iterator](): IterableIterator
<[string
, PatternCommand
]>
Returns an iterable of entries in the map.
Returns
IterableIterator
<[string
, PatternCommand
]>
Inherited from
AliasStore.[iterator]
Defined in
node_modules/typescript/lib/lib.es2015.iterable.d.ts:119
at
▸ at(index
): undefined
| PatternCommand
Identical to Array.at(). Returns the item at a given index, allowing for positive and negative integers. Negative integers count back from the last item in the collection.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the element to obtain |
Returns
undefined
| PatternCommand
Inherited from
AliasStore.at
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:98
clear
▸ clear(): void
Returns
void
Inherited from
AliasStore.clear
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:20
clone
▸ clone(): Collection
<string
, PatternCommand
>
Creates an identical shallow copy of this collection.
Returns
Collection
<string
, PatternCommand
>
Example
const newColl = someColl.clone();
Inherited from
AliasStore.clone
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:328
concat
▸ concat(...collections
): Collection
<string
, PatternCommand
>
Combines this collection with others into a new collection. None of the source collections are modified.
Parameters
Name | Type | Description |
---|---|---|
...collections | ReadonlyCollection <string , PatternCommand >[] | Collections to merge |
Returns
Collection
<string
, PatternCommand
>
Example
const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl);
Inherited from
AliasStore.concat
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:338
construct
▸ construct(Ctor
, data
): PatternCommand
Constructs a Piece instance.
Parameters
Name | Type | Description |
---|---|---|
Ctor | ILoaderResultEntry <PatternCommand > | The Piece's constructor used to build the instance. |
data | HydratedModuleData | The module's information |
Returns
An instance of the constructed piece.
Inherited from
AliasStore.construct
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:566
delete
▸ delete(key
): boolean
Parameters
Name | Type |
---|---|
key | string |
Returns
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Inherited from
AliasStore.delete
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:24
difference
▸ difference<T
>(other
): Collection
<string
, PatternCommand
| T
>
The difference method returns a new structure containing items where the key is present in one of the original structures but not the other.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
other | ReadonlyCollection <string , T > | The other Collection to filter against |
Returns
Collection
<string
, PatternCommand
| T
>
Inherited from
AliasStore.difference
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:378
each
▸ each(fn
): this
Identical to Map.forEach(), but returns the collection instead of undefined.
Parameters
Name | Type | Description |
---|---|---|
fn | (value : PatternCommand , key : string , collection : this ) => void | Function to execute for each element |
Returns
this
Example
collection
.each(user => console.log(user.username))
.filter(user => user.bot)
.each(user => console.log(user.username));
Inherited from
AliasStore.each
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:303
▸ each<T
>(fn
, thisArg
): this
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
fn | (this : T , value : PatternCommand , key : string , collection : this ) => void |
thisArg | T |
Returns
this
Inherited from
AliasStore.each
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:304
ensure
▸ ensure(key
, defaultValueGenerator
): PatternCommand
Obtains the value of the given key if it exists, otherwise sets and returns the value provided by the default value generator.
Parameters
Name | Type | Description |
---|---|---|
key | string | The key to get if it exists, or set otherwise |
defaultValueGenerator | (key : string , collection : this ) => PatternCommand | A function that generates the default value |
Returns
Example
collection.ensure(guildId, () => defaultGuildConfig);
Inherited from
AliasStore.ensure
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:41
entries
▸ entries(): IterableIterator
<[string
, PatternCommand
]>
Returns an iterable of key, value pairs for every entry in the map.
Returns
IterableIterator
<[string
, PatternCommand
]>
Inherited from
AliasStore.entries
Defined in
node_modules/typescript/lib/lib.es2015.iterable.d.ts:124
equals
▸ equals(collection
): boolean
Checks if this collection shares identical items with another. This is different to checking for equality using equal-signs, because the collections may be different objects, but contain the same data.
Parameters
Name | Type | Description |
---|---|---|
collection | ReadonlyCollection <string , PatternCommand > | Collection to compare with |
Returns
boolean
Whether the collections have identical contents
Inherited from
AliasStore.equals
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:347
every
▸ every<K2
>(fn
): this is Collection<K2, PatternCommand>
Checks if all items passes a test. Identical in behavior to Array.every().
Type parameters
Name | Type |
---|---|
K2 | extends string |
Parameters
Name | Type | Description |
---|---|---|
fn | (value : PatternCommand , key : string , collection : this ) => key is K2 | Function used to test (should return a boolean) |
Returns
this is Collection<K2, PatternCommand>
Example
collection.every(user => !user.bot);
Inherited from
AliasStore.every
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:269
▸ every<V2
>(fn
): this is Collection<string, V2>
Type parameters
Name | Type |
---|---|
V2 | extends PatternCommand |
Parameters
Name | Type |
---|---|
fn | (value : PatternCommand , key : string , collection : this ) => value is V2 |
Returns
this is Collection<string, V2>
Inherited from
AliasStore.every
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:270
▸ every(fn
): boolean
Parameters
Name | Type |
---|---|
fn | (value : PatternCommand , key : string , collection : this ) => unknown |
Returns
boolean
Inherited from
AliasStore.every
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:271
▸ every<This
, K2
>(fn
, thisArg
): this is Collection<K2, PatternCommand>
Type parameters
Name | Type |
---|---|
This | This |
K2 | extends string |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => key is K2 |
thisArg | This |
Returns
this is Collection<K2, PatternCommand>
Inherited from
AliasStore.every
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:272
▸ every<This
, V2
>(fn
, thisArg
): this is Collection<string, V2>
Type parameters
Name | Type |
---|---|
This | This |
V2 | extends PatternCommand |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => value is V2 |
thisArg | This |
Returns
this is Collection<string, V2>
Inherited from
AliasStore.every
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:273
▸ every<This
>(fn
, thisArg
): boolean
Type parameters
Name |
---|
This |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => unknown |
thisArg | This |
Returns
boolean
Inherited from
AliasStore.every
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:274
filter
▸ filter<K2
>(fn
): Collection
<K2
, PatternCommand
>
Identical to Array.filter(), but returns a Collection instead of an Array.
Type parameters
Name | Type |
---|---|
K2 | extends string |
Parameters
Name | Type | Description |
---|---|---|
fn | (value : PatternCommand , key : string , collection : this ) => key is K2 | The function to test with (should return boolean) |
Returns
Collection
<K2
, PatternCommand
>
Example
collection.filter(user => user.username === 'Bob');
Inherited from
AliasStore.filter
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:183
▸ filter<V2
>(fn
): Collection
<string
, V2
>
Type parameters
Name | Type |
---|---|
V2 | extends PatternCommand |
Parameters
Name | Type |
---|---|
fn | (value : PatternCommand , key : string , collection : this ) => value is V2 |
Returns
Collection
<string
, V2
>
Inherited from
AliasStore.filter
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:184
▸ filter(fn
): Collection
<string
, PatternCommand
>
Parameters
Name | Type |
---|---|
fn | (value : PatternCommand , key : string , collection : this ) => unknown |
Returns
Collection
<string
, PatternCommand
>
Inherited from
AliasStore.filter
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:185
▸ filter<This
, K2
>(fn
, thisArg
): Collection
<K2
, PatternCommand
>
Type parameters
Name | Type |
---|---|
This | This |
K2 | extends string |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => key is K2 |
thisArg | This |
Returns
Collection
<K2
, PatternCommand
>
Inherited from
AliasStore.filter
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:186
▸ filter<This
, V2
>(fn
, thisArg
): Collection
<string
, V2
>
Type parameters
Name | Type |
---|---|
This | This |
V2 | extends PatternCommand |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => value is V2 |
thisArg | This |
Returns
Collection
<string
, V2
>
Inherited from
AliasStore.filter
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:187
▸ filter<This
>(fn
, thisArg
): Collection
<string
, PatternCommand
>
Type parameters
Name |
---|
This |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => unknown |
thisArg | This |
Returns
Collection
<string
, PatternCommand
>
Inherited from
AliasStore.filter
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:188
find
▸ find<V2
>(fn
): undefined
| V2
Searches for a single item where the given function returns a truthy value. This behaves like
Array.find().
All collections used in Discord.js are mapped using their id
property, and if you want to find by id you
should use the get
method. See
MDN for details.
Type parameters
Name | Type |
---|---|
V2 | extends PatternCommand |
Parameters
Name | Type | Description |
---|---|---|
fn | (value : PatternCommand , key : string , collection : this ) => value is V2 | The function to test with (should return boolean) |
Returns
undefined
| V2
Example
collection.find(user => user.username === 'Bob');
Inherited from
AliasStore.find
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:142
▸ find(fn
): undefined
| PatternCommand
Parameters
Name | Type |
---|---|
fn | (value : PatternCommand , key : string , collection : this ) => unknown |
Returns
undefined
| PatternCommand
Inherited from
AliasStore.find
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:143
▸ find<This
, V2
>(fn
, thisArg
): undefined
| V2
Type parameters
Name | Type |
---|---|
This | This |
V2 | extends PatternCommand |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => value is V2 |
thisArg | This |
Returns
undefined
| V2
Inherited from
AliasStore.find
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:144
▸ find<This
>(fn
, thisArg
): undefined
| PatternCommand
Type parameters
Name |
---|
This |
Parameters
Name | Type |
---|---|
fn | (this : This , value : PatternCommand , key : string , collection : this ) => unknown |
thisArg | This |