mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
Made GuildChannel.toString return a mention (#543)
This commit is contained in:
committed by
Amish Shah
parent
642d768cdc
commit
b1772089d1
@@ -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}>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user