From 3d0c1df19d66bbb83e2fe73a9377bd6a8428f515 Mon Sep 17 00:00:00 2001 From: Sugden <28943913+NotSugden@users.noreply.github.com> Date: Fri, 28 Feb 2020 17:26:37 +0000 Subject: [PATCH] =?UTF-8?q?refactor(Guild)/fix(Util):=20use=20resolveID=20?= =?UTF-8?q?and=20regex=20for=20cleanCod=E2=80=A6=20(#3837)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(Guild): use resolveID instead of resolve(...).id * fix(Util): use regex for cleanCodeBlockContent --- src/structures/Guild.js | 2 +- src/util/Util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 9353f4de5..2368ae626 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -861,7 +861,7 @@ class Guild extends Base { } if (data.afkTimeout) _data.afk_timeout = Number(data.afkTimeout); if (typeof data.icon !== 'undefined') _data.icon = data.icon; - if (data.owner) _data.owner_id = this.client.users.resolve(data.owner).id; + if (data.owner) _data.owner_id = this.client.users.resolveID(data.owner); if (data.splash) _data.splash = data.splash; if (data.banner) _data.banner = data.banner; if (typeof data.explicitContentFilter !== 'undefined') { diff --git a/src/util/Util.js b/src/util/Util.js index bc47ada47..bc2f0f811 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -567,7 +567,7 @@ class Util { * @returns {string} */ static cleanCodeBlockContent(text) { - return text.replace('```', '`\u200b``'); + return text.replace(/```/g, '`\u200b``'); } /**