Files
dysnomia/lib/structures/PrivateThreadChannel.js
TTtie dc3129e2a4 refactor: switch to ESLint flat config, add JSDoc linting (#147)
This commit switches Dysnomia over to ESLint flat config for
futureproofing and better maintainability. For the most part, the
codebase will pass the test suite, apart from a few exceptions
introduced by the stylistic plugin which I believe are reasonable to
include.

Additionally, JSDoc linting was added to maintain proper 
alignment of various features.
2024-08-02 18:56:44 +00:00

35 lines
1.1 KiB
JavaScript

"use strict";
const ThreadChannel = require("./ThreadChannel");
/**
* Represents a private thread channel. See ThreadChannel for extra properties.
* @extends ThreadChannel
*/
class PrivateThreadChannel extends ThreadChannel {
constructor(data, client, messageLimit) {
super(data, client, messageLimit);
}
update(data, client) {
super.update(data, client);
if(data.thread_metadata !== undefined) {
/**
* Metadata for the thread
* @override
* @type {ThreadChannel.ThreadMetadata}
*/
this.threadMetadata = {
archiveTimestamp: Date.parse(data.thread_metadata.archive_timestamp),
archived: data.thread_metadata.archived,
autoArchiveDuration: data.thread_metadata.auto_archive_duration,
createTimestamp: !data.thread_metadata.create_timestamp ? null : Date.parse(data.thread_metadata.create_timestamp),
invitable: data.thread_metadata.invitable,
locked: data.thread_metadata.locked
};
}
}
}
module.exports = PrivateThreadChannel;