From 3974d1d0ca340b305223b85a7d79b7b79d1ac88f Mon Sep 17 00:00:00 2001 From: Miikka Virtanen Date: Fri, 30 Dec 2016 21:55:06 +0200 Subject: [PATCH] Fix channel name cleaning for fully non-ascii names --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index cfd456f..a42aee6 100644 --- a/index.js +++ b/index.js @@ -230,7 +230,7 @@ function getModmailChannel(user, allowCreate = true) { } else { if (! allowCreate) return Promise.resolve(null); - const cleanName = user.username.replace(/[^a-zA-Z0-9]/ig, '').toLowerCase().trim(); + let cleanName = user.username.replace(/[^a-zA-Z0-9]/ig, '').toLowerCase().trim(); if (cleanName === '') cleanName = 'unknown'; // If one is not found, create and cache it