feat(Channel): add isText() type guard (#4745)

This commit is contained in:
Jan
2020-08-31 09:59:17 +02:00
committed by GitHub
parent 3141f7cb04
commit b0ab37ddc0
2 changed files with 10 additions and 0 deletions

View File

@@ -97,6 +97,14 @@ class Channel extends Base {
return this.client.channels.fetch(this.id, true, force);
}
/**
* Indicates whether this channel is text-based.
* @returns {boolean}
*/
isText() {
return 'messages' in this;
}
static create(client, data, guild) {
const Structures = require('../util/Structures');
let channel;