@@ -1,5 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (client, { d: data }) =>
|
||||
// Client.user.messageMentions.delete(data.channel_id);
|
||||
`${client}:${data}`;
|
||||
const { Events } = require('../../../util/Constants');
|
||||
|
||||
module.exports = (client, { d: data }) => {
|
||||
const channel = client.channels.cache.get(data.channel_id);
|
||||
/**
|
||||
* Emitted whenever message is acknowledged (mark read / unread)
|
||||
* @event Client#messageAck
|
||||
* @param {TextChannel} channel Channel
|
||||
* @param {Snowflake} message_id Message ID
|
||||
* @param {boolean} isRead Whether the message is read
|
||||
* @param {Object} raw Raw data
|
||||
*/
|
||||
client.emit(Events.MESSAGE_ACK, channel, data.message_id, !data.manual, data);
|
||||
};
|
||||
|
@@ -34,6 +34,7 @@ const handlers = Object.fromEntries([
|
||||
['CHANNEL_DELETE', require('./CHANNEL_DELETE')],
|
||||
['CHANNEL_UPDATE', require('./CHANNEL_UPDATE')],
|
||||
['CHANNEL_PINS_UPDATE', require('./CHANNEL_PINS_UPDATE')],
|
||||
['MESSAGE_ACK', require('./MESSAGE_ACK')],
|
||||
['MESSAGE_CREATE', require('./MESSAGE_CREATE')],
|
||||
['MESSAGE_DELETE', require('./MESSAGE_DELETE')],
|
||||
['MESSAGE_UPDATE', require('./MESSAGE_UPDATE')],
|
||||
|
@@ -1014,6 +1014,20 @@ class Message extends Base {
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks the message as read.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
async markRead() {
|
||||
await this.client.api.channels[this.channelId].messages[this.id].ack.post({
|
||||
data: {
|
||||
token: null,
|
||||
},
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Click specific button [Suggestion: Dux#2925]
|
||||
* @param {string} buttonID Button ID
|
||||
|
@@ -80,11 +80,11 @@ class CustomStatus {
|
||||
|
||||
class RichPresence {
|
||||
/**
|
||||
* @param {Client} client Discord client
|
||||
* @param {Client} [client] Discord client
|
||||
* @param {RichPresence} [data={}] RichPresence to clone or raw data
|
||||
* @param {boolean} [IPC=false] Whether to use IPC (RPC for Discord Apps)
|
||||
*/
|
||||
constructor(client, data = {}, IPC = false) {
|
||||
constructor(client = {}, data = {}, IPC = false) {
|
||||
Object.defineProperty(this, 'client', { value: client });
|
||||
/**
|
||||
* The activity's name
|
||||
|
@@ -320,6 +320,7 @@ exports.Opcodes = {
|
||||
* * CHANNEL_DELETE: channelDelete
|
||||
* * CHANNEL_UPDATE: channelUpdate
|
||||
* * CHANNEL_PINS_UPDATE: channelPinsUpdate
|
||||
* * MESSAGE_ACK: messageAck
|
||||
* * MESSAGE_CREATE: messageCreate
|
||||
* * MESSAGE_DELETE: messageDelete
|
||||
* * MESSAGE_UPDATE: messageUpdate
|
||||
@@ -404,6 +405,7 @@ exports.Events = {
|
||||
CHANNEL_DELETE: 'channelDelete',
|
||||
CHANNEL_UPDATE: 'channelUpdate',
|
||||
CHANNEL_PINS_UPDATE: 'channelPinsUpdate',
|
||||
MESSAGE_ACK: 'messageAck',
|
||||
MESSAGE_CREATE: 'messageCreate',
|
||||
MESSAGE_DELETE: 'messageDelete',
|
||||
MESSAGE_UPDATE: 'messageUpdate',
|
||||
|
Reference in New Issue
Block a user