From 98c4fe9410c9144c26f389cf5290574f778d7967 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Fri, 23 Sep 2022 14:29:55 +0800 Subject: +meta + potentially fix links in g chat + if you are using sbgbot shows links eg for images in g chat again --- src/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/utils.js b/src/utils/utils.js index 1f6cd6e..015643d 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -130,7 +130,7 @@ let utils = { return c }, ["&" + color]).map(a => { if (a.match(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/igm)) { - return new TextComponent("&" + color + "&n" + a + "&" + color + ' ').setHover("show_text", "Click to open " + a.trim().replace(/^(?:[&§][0-9a-fmn])+|(?:[&§][0-9a-fmn])+$/g, "")).setClick("open_url", a.trim()) + return new TextComponent("&" + color + "&n" + a + "&" + color + ' ').setHover("show_text", "Click to open " + a.trim().replace(/^(?:[&§][0-9a-fmn])+|(?:[&§][0-9a-fmn])+$/g, "")).setClick("open_url", a.trim().replace(/[&§][0-9a-fmn]/g, "")) } else { return new TextComponent(a + ' ') } -- cgit