Files
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

38 lines
1.1 KiB
JavaScript

"use strict";
const TextChannel = require("./TextChannel");
/**
* Represents a guild news channel.
* @extends TextChannel
*/
class NewsChannel extends TextChannel {
#client;
constructor(data, client, messageLimit) {
super(data, client, messageLimit);
this.#client = client;
this.rateLimitPerUser = 0;
}
/**
* Crosspost (publish) a message to subscribed channels
* @param {String} messageID The ID of the message
* @returns {Promise<Message>}
*/
crosspostMessage(messageID) {
return this.#client.crosspostMessage.call(this.#client, this.id, messageID);
}
/**
* Follow this channel in another channel. This creates a webhook in the target channel
* @param {String} webhookChannelID The ID of the target channel
* @param {String} [reason] The reason to be displayed in audit logs
* @returns {Object} An object containing this channel's ID and the new webhook's ID
*/
follow(webhookChannelID, reason) {
return this.#client.followChannel.call(this.#client, this.id, webhookChannelID, reason);
}
}
module.exports = NewsChannel;