mirror of
https://github.com/ION606/custom_discordjs.git
synced 2026-05-14 22:26:54 +00:00
52 lines
879 B
JavaScript
52 lines
879 B
JavaScript
|
|
const messageChannelTypes = require('./messageChannelTypes.js');
|
||
|
|
|
||
|
|
|
||
|
|
class message {
|
||
|
|
|
||
|
|
|
||
|
|
/** @type {Object} */
|
||
|
|
author;
|
||
|
|
|
||
|
|
/** @type {Object} */
|
||
|
|
channel_id;
|
||
|
|
|
||
|
|
/** @type {Object[]} */
|
||
|
|
mentions;
|
||
|
|
|
||
|
|
/** @type {Object} */
|
||
|
|
member;
|
||
|
|
|
||
|
|
/** @type {String} */
|
||
|
|
id;
|
||
|
|
|
||
|
|
/** @type {Object} */
|
||
|
|
content;
|
||
|
|
|
||
|
|
/** @type {Object[]} */
|
||
|
|
attachments;
|
||
|
|
|
||
|
|
/** @type {String} */
|
||
|
|
guild_id;
|
||
|
|
|
||
|
|
/** @type {Object} */
|
||
|
|
type;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param {Object} msgRaw
|
||
|
|
*/
|
||
|
|
constructor(msgRaw) {
|
||
|
|
for (const k in this) {
|
||
|
|
if (msgRaw[k] != undefined) {
|
||
|
|
if (k == 'type') {
|
||
|
|
this.type = (msgRaw['guild_id']) ? msgRaw[k] : 1;
|
||
|
|
} else {
|
||
|
|
this[k] = msgRaw[k];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
module.exports = { message, messageChannelTypes };
|