From cd4a69d009e9765f2f2ca87feede7435abdda902 Mon Sep 17 00:00:00 2001 From: Crawl Date: Sat, 12 Aug 2017 11:50:15 +0200 Subject: [PATCH] Add Guild#nameAcronym --- src/structures/Guild.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/structures/Guild.js b/src/structures/Guild.js index b801ff6d9..2530029f5 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -263,6 +263,15 @@ class Guild { return Constants.Endpoints.Guild(this).Icon(this.client.options.http.cdn, this.icon); } + /** + * Gets the acronym that shows up in place of a guild icon + * @type {string} + * @readonly + */ + get nameAcronym() { + return this.name.replace(/\w+/g, name => name[0]).replace(/\s/g, ''); + } + /** * The URL to this guild's splash * @type {?string}