mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
add DMChannel docs
This commit is contained in:
parent
3e3a411a42
commit
863495cda0
2 changed files with 27 additions and 1 deletions
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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue