mirror of
https://github.com/danbulant/discord.js
synced 2026-05-26 21:42:05 +00:00
Made GuildChannel.toString return a mention (#543)
This commit is contained in:
parent
642d768cdc
commit
b1772089d1
1 changed files with 5 additions and 5 deletions
|
|
@ -263,17 +263,17 @@ class GuildChannel extends Channel {
|
|||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a String, this automatically returns the Channel's name instead of the Channel object.
|
||||
* When concatenated with a String, this automatically returns the Channel's mention instead of the Channel object.
|
||||
* @returns {String}
|
||||
* @example
|
||||
* // Outputs: Hello from general
|
||||
* // Outputs: Hello from #general
|
||||
* console.log(`Hello from ${channel}`);
|
||||
* @example
|
||||
* // Outputs: Hello from general
|
||||
* console.log('Hello from ' + ${channel});
|
||||
* // Outputs: Hello from #general
|
||||
* console.log('Hello from ' + channel);
|
||||
*/
|
||||
toString() {
|
||||
return this.name;
|
||||
return `<#${this.id}>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue