mirror of
https://github.com/discordjs/discord.js.git
synced 2026-05-28 06:20:10 +00:00
Compare commits
4 Commits
@discordjs
...
11.6.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de0cacdf32 | ||
|
|
bb4cb3e7fe | ||
|
|
08865a98cd | ||
|
|
20075e306b |
@@ -23,7 +23,7 @@ The usage of the API isn't any different from using it in Node.js.
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
```html
|
```html
|
||||||
<script type="text/javascript" src="discord.11.5.0.min.js"></script>
|
<script type="text/javascript" src="discord.11.6.2.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const client = new Discord.Client();
|
const client = new Discord.Client();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "discord.js",
|
"name": "discord.js",
|
||||||
"version": "11.6.1",
|
"version": "11.6.3",
|
||||||
"description": "A powerful library for interacting with the Discord API",
|
"description": "A powerful library for interacting with the Discord API",
|
||||||
"main": "./src/index",
|
"main": "./src/index",
|
||||||
"types": "./typings/index.d.ts",
|
"types": "./typings/index.d.ts",
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class WebSocketPacketManager {
|
|||||||
this.register(Constants.WSEvents.RELATIONSHIP_REMOVE, require('./handlers/RelationshipRemove'));
|
this.register(Constants.WSEvents.RELATIONSHIP_REMOVE, require('./handlers/RelationshipRemove'));
|
||||||
this.register(Constants.WSEvents.MESSAGE_REACTION_ADD, require('./handlers/MessageReactionAdd'));
|
this.register(Constants.WSEvents.MESSAGE_REACTION_ADD, require('./handlers/MessageReactionAdd'));
|
||||||
this.register(Constants.WSEvents.MESSAGE_REACTION_REMOVE, require('./handlers/MessageReactionRemove'));
|
this.register(Constants.WSEvents.MESSAGE_REACTION_REMOVE, require('./handlers/MessageReactionRemove'));
|
||||||
this.register(Constants.WSEvents.MESSAGE_REACTION_REMOVE, require('./handlers/MessageReactionRemoveEmoji'));
|
this.register(Constants.WSEvents.MESSAGE_REACTION_REMOVE_EMOJI, require('./handlers/MessageReactionRemoveEmoji'));
|
||||||
this.register(Constants.WSEvents.MESSAGE_REACTION_REMOVE_ALL, require('./handlers/MessageReactionRemoveAll'));
|
this.register(Constants.WSEvents.MESSAGE_REACTION_REMOVE_ALL, require('./handlers/MessageReactionRemoveAll'));
|
||||||
this.register(Constants.WSEvents.WEBHOOKS_UPDATE, require('./handlers/WebhooksUpdate'));
|
this.register(Constants.WSEvents.WEBHOOKS_UPDATE, require('./handlers/WebhooksUpdate'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ class ReactionCollector extends Collector {
|
|||||||
|
|
||||||
if (this.client.getMaxListeners() !== 0) this.client.setMaxListeners(this.client.getMaxListeners() + 1);
|
if (this.client.getMaxListeners() !== 0) this.client.setMaxListeners(this.client.getMaxListeners() + 1);
|
||||||
this.client.on('messageReactionAdd', this.listener);
|
this.client.on('messageReactionAdd', this.listener);
|
||||||
|
|
||||||
|
this.on('fullCollect', (reaction, user) => {
|
||||||
|
this.users.set(user.id, user);
|
||||||
|
this.total++;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,9 +69,8 @@ class ReactionCollector extends Collector {
|
|||||||
* @returns {?string} Reason to end the collector, if any
|
* @returns {?string} Reason to end the collector, if any
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
postCheck(reaction, user) {
|
postCheck() {
|
||||||
this.users.set(user.id, user);
|
if (this.options.max && this.total >= this.options.max) return 'limit';
|
||||||
if (this.options.max && ++this.total >= this.options.max) return 'limit';
|
|
||||||
if (this.options.maxEmojis && this.collected.size >= this.options.maxEmojis) return 'emojiLimit';
|
if (this.options.maxEmojis && this.collected.size >= this.options.maxEmojis) return 'emojiLimit';
|
||||||
if (this.options.maxUsers && this.users.size >= this.options.maxUsers) return 'userLimit';
|
if (this.options.maxUsers && this.users.size >= this.options.maxUsers) return 'userLimit';
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -99,6 +99,14 @@ class Collector extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
this.emit('collect', collect.value, this);
|
this.emit('collect', collect.value, this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emitted whenever an element is collected.
|
||||||
|
* @event Collector#fullCollect
|
||||||
|
* @param {...*} args The arguments emitted by the listener
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
this.emit('fullCollect', ...args, this);
|
||||||
|
|
||||||
if (this._idletimeout) {
|
if (this._idletimeout) {
|
||||||
this.client.clearTimeout(this._idletimeout);
|
this.client.clearTimeout(this._idletimeout);
|
||||||
this._idletimeout = this.client.setTimeout(() => this.stop('idle'), this.options.idle);
|
this._idletimeout = this.client.setTimeout(() => this.stop('idle'), this.options.idle);
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ exports.WSEvents = {
|
|||||||
MESSAGE_DELETE_BULK: 'MESSAGE_DELETE_BULK',
|
MESSAGE_DELETE_BULK: 'MESSAGE_DELETE_BULK',
|
||||||
MESSAGE_REACTION_ADD: 'MESSAGE_REACTION_ADD',
|
MESSAGE_REACTION_ADD: 'MESSAGE_REACTION_ADD',
|
||||||
MESSAGE_REACTION_REMOVE: 'MESSAGE_REACTION_REMOVE',
|
MESSAGE_REACTION_REMOVE: 'MESSAGE_REACTION_REMOVE',
|
||||||
MESSAGE_REACTION_RMEOVE_EMOJI: 'MESSAGE_REACTION_REMOVE_EMOJI',
|
MESSAGE_REACTION_REMOVE_EMOJI: 'MESSAGE_REACTION_REMOVE_EMOJI',
|
||||||
MESSAGE_REACTION_REMOVE_ALL: 'MESSAGE_REACTION_REMOVE_ALL',
|
MESSAGE_REACTION_REMOVE_ALL: 'MESSAGE_REACTION_REMOVE_ALL',
|
||||||
USER_UPDATE: 'USER_UPDATE',
|
USER_UPDATE: 'USER_UPDATE',
|
||||||
USER_NOTE_UPDATE: 'USER_NOTE_UPDATE',
|
USER_NOTE_UPDATE: 'USER_NOTE_UPDATE',
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
// Type definitions for discord.js 11.6.1
|
// Type definitions for discord.js 11.6.2
|
||||||
// Project: https://github.com/discordjs/discord.js
|
// Project: https://github.com/discordjs/discord.js
|
||||||
// Definitions by:
|
// Definitions by:
|
||||||
// acdenisSK <acdenissk69@gmail.com> (https://github.com/acdenisSK)
|
// acdenisSK <acdenissk69@gmail.com> (https://github.com/acdenisSK)
|
||||||
|
|||||||
Reference in New Issue
Block a user