mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +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}
|
* @returns {String}
|
||||||
* @example
|
* @example
|
||||||
* // Outputs: Hello from general
|
* // Outputs: Hello from #general
|
||||||
* console.log(`Hello from ${channel}`);
|
* console.log(`Hello from ${channel}`);
|
||||||
* @example
|
* @example
|
||||||
* // Outputs: Hello from general
|
* // Outputs: Hello from #general
|
||||||
* console.log('Hello from ' + ${channel});
|
* console.log('Hello from ' + channel);
|
||||||
*/
|
*/
|
||||||
toString() {
|
toString() {
|
||||||
return this.name;
|
return `<#${this.id}>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user