mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
add DMChannel docs
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -3,6 +3,11 @@ const TextBasedChannel = require('./interface/TextBasedChannel');
|
||||
const User = require('./User');
|
||||
const TextChannelDataStore = require('./datastore/TextChannelDataStore');
|
||||
|
||||
/**
|
||||
* Represents a Direct Message Channel between two users.
|
||||
* @extends {Channel}
|
||||
* @implements {TextBasedChannel}
|
||||
*/
|
||||
class DMChannel extends Channel {
|
||||
constructor(client, data) {
|
||||
super(client, data);
|
||||
@@ -26,13 +31,34 @@ class DMChannel extends Channel {
|
||||
|
||||
setup(data) {
|
||||
super.setup(data);
|
||||
/**
|
||||
* The recipient on the other end of the DM
|
||||
* @type {User}
|
||||
*/
|
||||
this.recipient = this.client.store.add('users', new User(this.client, data.recipients[0]));
|
||||
/**
|
||||
* The ID of the last sent message, if available
|
||||
* @type {?String}
|
||||
*/
|
||||
this.lastMessageID = data.last_message_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a String, this automatically concatenates the recipient's mention instead of the
|
||||
* DM channel object.
|
||||
* @returns {String}
|
||||
*/
|
||||
toString() {
|
||||
return this.recipient.toString();
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
return;
|
||||
}
|
||||
|
||||
sendTTSMessage() {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
TextBasedChannel.applyToClass(DMChannel);
|
||||
|
||||
Reference in New Issue
Block a user