22
src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js
Normal file
22
src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
/**
|
||||
* Poll Vote Structure
|
||||
* @see {@link https://docs.discord.sex/resources/message#poll-results-structure}
|
||||
* @typedef {Object} MessagePollUserVote
|
||||
* @property {Snowflake} user_id ID of the user
|
||||
* @property {Snowflake} channel_id ID of the channel
|
||||
* @property {Snowflake} message_id ID of the message
|
||||
* @property {?Snowflake} guild_id ID of the guild
|
||||
* @property {number} answer_id ID of the answer
|
||||
*/
|
||||
/**
|
||||
* Emitted when a user votes on a poll. If the poll allows multiple selection, one event will be sent per answer.
|
||||
* @event Client#messagePollVoteAdd
|
||||
* @param {MessagePollUserVote} data Raw data
|
||||
*/
|
||||
client.emit(Events.MESSAGE_POLL_VOTE_ADD, data);
|
||||
};
|
||||
12
src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js
Normal file
12
src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.js
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
/**
|
||||
* Emitted when a user removes their vote on a poll. If the poll allows for multiple selections, one event will be sent per answer.
|
||||
* @event Client#messagePollVoteRemove
|
||||
* @param {MessagePollUserVote} data Raw data
|
||||
*/
|
||||
client.emit(Events.MESSAGE_POLL_VOTE_REMOVE, data);
|
||||
};
|
||||
@@ -10,7 +10,7 @@ module.exports = (client, { d: data }) => {
|
||||
* Emitted when a relationship is removed, relevant to the current user.
|
||||
* @event Client#relationshipRemove
|
||||
* @param {Snowflake} user The userID that was updated
|
||||
* @param {RelationshipTypes} type The type of the old relationship
|
||||
* @param {RelationshipType} type The type of the old relationship
|
||||
* @param {string | null} nickname The nickname of the user in this relationship (1-32 characters)
|
||||
*/
|
||||
client.emit(Events.RELATIONSHIP_REMOVE, data.id, data.type, data.nickname);
|
||||
|
||||
@@ -5,7 +5,7 @@ const { Events } = require('../../../util/Constants');
|
||||
module.exports = (client, { d: data }) => {
|
||||
/**
|
||||
* @typedef {Object} RelationshipUpdateObject
|
||||
* @property {RelationshipTypes} type The type of relationship
|
||||
* @property {RelationshipType} type The type of relationship
|
||||
* @property {Date} since When the user requested a relationship
|
||||
* @property {string | null} nickname The nickname of the user in this relationship (1-32 characters)
|
||||
*/
|
||||
|
||||
@@ -76,6 +76,8 @@ const handlers = Object.fromEntries([
|
||||
['USER_SETTINGS_UPDATE', require('./USER_SETTINGS_UPDATE')],
|
||||
['USER_GUILD_SETTINGS_UPDATE', require('./USER_GUILD_SETTINGS_UPDATE')],
|
||||
['VOICE_CHANNEL_STATUS_UPDATE', require('./VOICE_CHANNEL_STATUS_UPDATE')],
|
||||
['MESSAGE_POLL_VOTE_ADD', require('./MESSAGE_POLL_VOTE_ADD')],
|
||||
['MESSAGE_POLL_VOTE_REMOVE', require('./MESSAGE_POLL_VOTE_REMOVE')],
|
||||
]);
|
||||
|
||||
module.exports = handlers;
|
||||
|
||||
Reference in New Issue
Block a user