File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,14 @@ class Channel extends Base {
9797 return this . client . channels . fetch ( this . id , true , force ) ;
9898 }
9999
100+ /**
101+ * Indicates whether this channel is text-based.
102+ * @returns {boolean }
103+ */
104+ isText ( ) {
105+ return 'messages' in this ;
106+ }
107+
100108 static create ( client , data , guild ) {
101109 const Structures = require ( '../util/Structures' ) ;
102110 let channel ;
Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ declare module 'discord.js' {
187187 public type : keyof typeof ChannelType ;
188188 public delete ( reason ?: string ) : Promise < Channel > ;
189189 public fetch ( force ?: boolean ) : Promise < Channel > ;
190+ public isText ( ) : this is TextChannel | DMChannel | NewsChannel ;
190191 public toString ( ) : string ;
191192 }
192193
@@ -826,6 +827,7 @@ declare module 'discord.js' {
826827 options : PermissionOverwriteOption ,
827828 reason ?: string ,
828829 ) : Promise < this> ;
830+ public isText ( ) : this is TextChannel | NewsChannel ;
829831 }
830832
831833 export class GuildEmoji extends BaseGuildEmoji {
You can’t perform that action at this time.
0 commit comments