diff --git a/packages/discord.js/src/util/Util.js b/packages/discord.js/src/util/Util.js index eb052d059..4540606e9 100644 --- a/packages/discord.js/src/util/Util.js +++ b/packages/discord.js/src/util/Util.js @@ -189,7 +189,7 @@ class Util extends null { * @returns {string} */ static escapeInlineCode(text) { - return text.replaceAll('`', '\\`'); + return text.replace(/(?<=^|[^`])``?(?=[^`]|$)/g, match => (match.length === 2 ? '\\`\\`' : '\\`')); } /**