Initial code commit

This commit is contained in:
ION606
2023-03-18 18:02:17 -04:00
parent 24316888ec
commit 35b993b3fe
12 changed files with 718 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
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 };