Skip to content

Commit a18b0d6

Browse files
committed
Docs build for branch master: d5f45df
1 parent d5f45df commit a18b0d6

File tree

5 files changed

+191
-13
lines changed

5 files changed

+191
-13
lines changed

docs/Core/GuildConfigCache.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
* _instance_
1818
* [.guildConfigs](#GuildConfigsCache+guildConfigs) : <code>LRUCache.&lt;GuildConfig&gt;</code>
1919
* [.getOrFetch(key)](#GuildConfigsCache+getOrFetch) ⇒ <code>Promise.&lt;([GuildConfig](Core/GuildConfig)\|null)&gt;</code>
20-
* [.fetchGuildConf(gID)](#GuildConfigsCache+fetchGuildConf) ⇒ <code>Promise.&lt;([GuildConfig](Core/GuildConfig)\|null)&gt;</code>
20+
* [.fetch(gID)](#GuildConfigsCache+fetch) ⇒ <code>Promise.&lt;([GuildConfig](Core/GuildConfig)\|null)&gt;</code>
21+
* [.refresh(gID)](#GuildConfigsCache+refresh) ⇒ <code>Boolean</code>
2122
* _static_
2223
* [.GuildConfigsCache](#GuildConfigsCache.GuildConfigsCache)
23-
* [new GuildConfigsCache(axonClient)](#new_GuildConfigsCache.GuildConfigsCache_new)
24+
* [new GuildConfigsCache(axonClient, limit)](#new_GuildConfigsCache.GuildConfigsCache_new)
2425

2526
<a name="new_GuildConfigsCache_new"></a>
2627

@@ -46,9 +47,9 @@ Get a GuildConfig from the cache or from the DB if not in the cache.
4647
| --- | --- |
4748
| key | <code>String</code> |
4849

49-
<a name="GuildConfigsCache+fetchGuildConf"></a>
50+
<a name="GuildConfigsCache+fetch"></a>
5051

51-
### guildConfigsCache.fetchGuildConf(gID) ⇒ <code>Promise.&lt;([GuildConfig](Core/GuildConfig)\|null)&gt;</code>
52+
### guildConfigsCache.fetch(gID) ⇒ <code>Promise.&lt;([GuildConfig](Core/GuildConfig)\|null)&gt;</code>
5253
Fetches and resolves the guild config of the given ID from the DB, creates a schema if none was found or there was an error.
5354

5455
**Kind**: instance method of [<code>GuildConfigsCache</code>](#GuildConfigsCache)
@@ -58,17 +59,30 @@ Fetches and resolves the guild config of the given ID from the DB, creates a sch
5859
| --- | --- | --- |
5960
| gID | <code>String</code> | The guild ID to fetch the DB |
6061

62+
<a name="GuildConfigsCache+refresh"></a>
63+
64+
### guildConfigsCache.refresh(gID) ⇒ <code>Boolean</code>
65+
Refresh the element by supressing it, fetching and caching it again
66+
67+
**Kind**: instance method of [<code>GuildConfigsCache</code>](#GuildConfigsCache)
68+
**Returns**: <code>Boolean</code> - Whether it worked
69+
70+
| Param | Type |
71+
| --- | --- |
72+
| gID | <code>String</code> |
73+
6174
<a name="GuildConfigsCache.GuildConfigsCache"></a>
6275

6376
### GuildConfigsCache.GuildConfigsCache
6477
**Kind**: static class of [<code>GuildConfigsCache</code>](#GuildConfigsCache)
6578
<a name="new_GuildConfigsCache.GuildConfigsCache_new"></a>
6679

67-
#### new GuildConfigsCache(axonClient)
80+
#### new GuildConfigsCache(axonClient, limit)
6881
Creates an instance of GuildConfigsCache.
6982

7083

71-
| Param | Type |
72-
| --- | --- |
73-
| axonClient | <code>[AxonClient](AxonClient)</code> |
84+
| Param | Type | Description |
85+
| --- | --- | --- |
86+
| axonClient | <code>[AxonClient](AxonClient)</code> | |
87+
| limit | <code>Number</code> | The limit of item in the LRUCache |
7488

docs/Enums/DiscordEnums.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
## CLIENT\_STATUS\_TYPES : <code>enum</code>
3333
**Kind**: global enum
3434
**Read only**: true
35+
<a name="PUBLIC_FLAGS"></a>
36+
37+
## PUBLIC\_FLAGS : <code>enum</code>
38+
**Kind**: global enum
39+
**Read only**: true
3540
<a name="DISCORD_GATEWAY_EVENTS"></a>
3641

3742
## DISCORD\_GATEWAY\_EVENTS

docs/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,21 @@ You can create commands by extending [Command](src/Core/Command/Command.js), [Co
9999

100100
### Listeners
101101

102-
You can also create listeners by extending [Listener](src/Core/Listener.js).
102+
You can also create listeners by extending [Listener](src/Core/Event/Listener.js).
103103
A **Listener** is a function that is run when a Discord-specific event occurs. Many listeners can be bound to one Discord event.
104104
A **Handler** is an object responsible of running all listeners for a specific Discord event.
105105

106106
### Databases support
107107

108-
All database interactions are done by AxonCore via a [DBProvider](src/Database/DBProvider.js).
108+
All database interactions are done by AxonCore via an [ADBProvider](src/Database/ADBProvider.js).
109109
There are specific providers for each type of Database, such as:
110110

111111
- JSON
112112
- MongoDB ([mongoose](https://github.com/Automattic/mongoose))
113113
- SQL ([sequelize](https://github.com/sequelize/sequelize)) [TODO]
114114
- SQLite () [TODO]
115115

116-
The only thing you will handle is a [GuildConfig](src/Core/Models/GuildConfig.js) and an [AxonConfig](src/Core/Models/AxonConfig.js) object. Those are stored in the [GuildConfigCache](src/Core/GuildConfigCache.js).
116+
The only thing you will handle is a [GuildConfig](src/Core/Models/GuildConfig.js) and an [AxonConfig](src/Core/Models/AxonConfig.js) object. Those are stored in the [GuildConfigCache](src/Core/Stores/GuildConfigCache.js).
117117

118118
### Translation support
119119

@@ -163,7 +163,7 @@ axonClient.on('listenerError', (eventName: String, listenerName: String, { liste
163163

164164
### Utilities
165165

166-
- [Embed](src/Utility/External/Embed.js)
166+
- [Embed](src/Utility/Discord/Embed.js)
167167
- [Resolver](src/Libraries/definitions/Resolver.js)
168168
- [Utility](src/Utility/Utils.js)
169169
- [Collectors](src/Utility/Discord/Collectors/Collector.js)
@@ -186,7 +186,7 @@ axonClient.on('listenerError', (eventName: String, listenerName: String, { liste
186186
See [here](https://www.npmjs.com/package/esm#getting-started) on how to use ESM.
187187
You don't however need ESM to use this framework, using require is also compatible.
188188

189-
You can use any Database you want. If support for this Database isn't built-in, you can create your own by extending [DBProvider](src/Database/DBProvider.js) and passing it in [AxonOptions](src/AxonOptions.js).
189+
You can use any Database you want. If support for this Database isn't built-in, you can create your own by extending [ADBProvider](src/Database/ADBProvider.js) and passing it in [AxonOptions](src/AxonOptions.js).
190190
There is currently support for: [Mongoose](https://github.com/Automattic/mongoose).
191191
You can also use the available JSON variant, if you don't need a DB solution.
192192

docs/Utility/ReactionCollector.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<a name="ReactionCollector"></a>
2+
3+
## ReactionCollector ⇐ <code>Collector&lt;Message&gt;</code>
4+
**Kind**: global class
5+
**Extends**: <code>Collector&lt;Message&gt;</code>
6+
**Author**: Bsian, KhaaZ
7+
**Properties**
8+
9+
| Name | Type | Description |
10+
| --- | --- | --- |
11+
| options | <code>Object</code> | |
12+
| options.timeout | <code>Number</code> | Number of ms before timing out |
13+
| options.count | <code>Number</code> | Number of reactions to collect |
14+
| options.ignoreBots | <code>Boolean</code> | Whether to ignore bots |
15+
| options.userID | <code>String</code> | Specify a userID to only collect message from this user |
16+
17+
18+
* [ReactionCollector](#ReactionCollector) ⇐ <code>Collector&lt;Message&gt;</code>
19+
* [new ReactionCollector()](#new_ReactionCollector_new)
20+
* _instance_
21+
* [.run(message, [options])](#ReactionCollector+run) ⇒ <code>Promise.&lt;Map.&lt;String, Message&gt;&gt;</code>
22+
* [.getCollectors(message)](#ReactionCollector+getCollectors) ⇒ <code>Array.&lt;CollectorContainer.&lt;Message&gt;&gt;</code>
23+
* [._onMessageReactionAdd(msg, emoji, userID)](#ReactionCollector+_onMessageReactionAdd)
24+
* [._onMessageReactionRemove(msg, emoji, userID)](#ReactionCollector+_onMessageReactionRemove)
25+
* [._onMessageReactionRemoveAll(msg)](#ReactionCollector+_onMessageReactionRemoveAll)
26+
* [._onMessageReactionRemoveEmoji(msg, emoji)](#ReactionCollector+_onMessageReactionRemoveEmoji)
27+
* _static_
28+
* [.ReactionCollector](#ReactionCollector.ReactionCollector)
29+
* [new ReactionCollector(client, [options])](#new_ReactionCollector.ReactionCollector_new)
30+
31+
<a name="new_ReactionCollector_new"></a>
32+
33+
### new ReactionCollector()
34+
Collect bunch of message object according to chosen options
35+
36+
<a name="ReactionCollector+run"></a>
37+
38+
### reactionCollector.run(message, [options]) ⇒ <code>Promise.&lt;Map.&lt;String, Message&gt;&gt;</code>
39+
Runs the message collector
40+
41+
**Kind**: instance method of [<code>ReactionCollector</code>](#ReactionCollector)
42+
**Returns**: <code>Promise.&lt;Map.&lt;String, Message&gt;&gt;</code> - Map of messages collected.
43+
44+
| Param | Type | Description |
45+
| --- | --- | --- |
46+
| message | <code>Message</code> | The message object to listen to |
47+
| [options] | <code>Object</code> | The options for the reaction collector |
48+
| [options.timeout] | <code>Number</code> | The time before the collector times out in milliseconds |
49+
| [options.count] | <code>Number</code> | The amount of reactions to collect before automatically ending |
50+
| [options.ignoreBots] | <code>Boolean</code> | Whether or not to ignore bots |
51+
| [options.userID] | <code>String</code> | The user id to listen for (listens to all messages if not specified) |
52+
| [options.emojis] | <code>Array.&lt;String&gt;</code> | The specific reactions to collect (collects all reactions if not specified) |
53+
54+
**Example**
55+
```js
56+
const reactions = await collector.run(msg, { count: 10 });
57+
```
58+
<a name="ReactionCollector+getCollectors"></a>
59+
60+
### reactionCollector.getCollectors(message) ⇒ <code>Array.&lt;CollectorContainer.&lt;Message&gt;&gt;</code>
61+
Get all CollectorContainers that will collect from this particular message
62+
63+
**Kind**: instance method of [<code>ReactionCollector</code>](#ReactionCollector)
64+
65+
| Param | Type |
66+
| --- | --- |
67+
| message | <code>Message</code> |
68+
69+
<a name="ReactionCollector+_onMessageReactionAdd"></a>
70+
71+
### reactionCollector.\_onMessageReactionAdd(msg, emoji, userID)
72+
Function bound to messageReactionAdd event.
73+
Collect the reaction for all collectors that respond to the criteria
74+
Emits collect event.
75+
76+
**Kind**: instance method of [<code>ReactionCollector</code>](#ReactionCollector)
77+
78+
| Param | Type |
79+
| --- | --- |
80+
| msg | <code>Message</code> |
81+
| emoji | <code>Emoji</code> |
82+
| userID | <code>String</code> |
83+
84+
<a name="ReactionCollector+_onMessageReactionRemove"></a>
85+
86+
### reactionCollector.\_onMessageReactionRemove(msg, emoji, userID)
87+
Function bound to messageReactionRemove event.
88+
Remove the reaction from all collectors that collected this reaction
89+
90+
**Kind**: instance method of [<code>ReactionCollector</code>](#ReactionCollector)
91+
92+
| Param | Type |
93+
| --- | --- |
94+
| msg | <code>Message</code> |
95+
| emoji | <code>Emoji</code> |
96+
| userID | <code>String</code> |
97+
98+
<a name="ReactionCollector+_onMessageReactionRemoveAll"></a>
99+
100+
### reactionCollector.\_onMessageReactionRemoveAll(msg)
101+
Function bound to messageReactionRemoveAll event.
102+
Updates the reaction from all collectors that collected this reaction
103+
104+
**Kind**: instance method of [<code>ReactionCollector</code>](#ReactionCollector)
105+
106+
| Param | Type |
107+
| --- | --- |
108+
| msg | <code>Message</code> |
109+
110+
<a name="ReactionCollector+_onMessageReactionRemoveEmoji"></a>
111+
112+
### reactionCollector.\_onMessageReactionRemoveEmoji(msg, emoji)
113+
Function bound to messageReactionRemoveEmoji event.
114+
Updates the reaction from all collectors that collected this reaction
115+
116+
**Kind**: instance method of [<code>ReactionCollector</code>](#ReactionCollector)
117+
118+
| Param | Type |
119+
| --- | --- |
120+
| msg | <code>Message</code> |
121+
| emoji | <code>Emoji</code> |
122+
123+
<a name="ReactionCollector.ReactionCollector"></a>
124+
125+
### ReactionCollector.ReactionCollector
126+
**Kind**: static class of [<code>ReactionCollector</code>](#ReactionCollector)
127+
<a name="new_ReactionCollector.ReactionCollector_new"></a>
128+
129+
#### new ReactionCollector(client, [options])
130+
Creates an instance of ReactionCollector
131+
132+
133+
| Param | Type | Default | Description |
134+
| --- | --- | --- | --- |
135+
| client | <code>[AxonClient](AxonClient)</code> | | The axon client object |
136+
| [options] | <code>Object</code> | | The default options for the reaction collector instance |
137+
| [options.timeout] | <code>Number</code> | <code>10000</code> | The time before the collector times out in milliseconds |
138+
| [options.count] | <code>Number</code> | <code>10</code> | The amount of reactions to collect before automatically ending |
139+
| [options.ignoreBots] | <code>Boolean</code> | <code>true</code> | Whether or not to ignore bots |
140+
| [options.userID] | <code>String</code> | | The user id to listen for (listens to all reactions if not specified) |
141+
| [options.emojis] | <code>Array.&lt;String&gt;</code> | | The specific reactions to collect (collects all reactions if not specified) |
142+
143+
**Example**
144+
```js
145+
const collector = new ReactionCollector(this.axon, { count: 10, ignoreBots: false });
146+
```

docs/Utility/Utils.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
* [.missingPerms(member, [permissions])](#Utils+missingPerms) ⇒ <code>Array.&lt;String&gt;</code>
4848
* [.missingChannelPerms(channel, member, [permissions])](#Utils+missingChannelPerms) ⇒ <code>Array.&lt;String&gt;</code>
4949
* [.calculatePerms(data)](#Utils+calculatePerms) ⇒ <code>Object</code>
50+
* [.calculateUserFlags(bits)](#Utils+calculateUserFlags) ⇒ <code>Array.&lt;string&gt;</code>
5051
* [.sleep(ms)](#Utils+sleep) ⇒ <code>Promise.&lt;void&gt;</code>
5152
* [.readFileAsync(path)](#Utils+readFileAsync) ⇒ <code>Promise.&lt;String&gt;</code>
5253
* [.writeFileAsync(path, content)](#Utils+writeFileAsync) ⇒ <code>Promise.&lt;void&gt;</code>
@@ -242,6 +243,18 @@ Calculate permissions using a object of perms
242243
| --- | --- | --- |
243244
| data | <code>Object</code> | The permissions to calculate for |
244245

246+
<a name="Utils+calculateUserFlags"></a>
247+
248+
### utils.calculateUserFlags(bits) ⇒ <code>Array.&lt;string&gt;</code>
249+
Calculate a users flags based off of the flags byte.
250+
251+
**Kind**: instance method of [<code>Utils</code>](#Utils)
252+
**Returns**: <code>Array.&lt;string&gt;</code> - String array of flags given bits hold.
253+
254+
| Param | Type | Description |
255+
| --- | --- | --- |
256+
| bits | <code>number</code> | Bits to calculate for |
257+
245258
<a name="Utils+sleep"></a>
246259

247260
### utils.sleep(ms) ⇒ <code>Promise.&lt;void&gt;</code>

0 commit comments

Comments
 (0)