Explorar o código

dicord: include link

Joystream Stats %!s(int64=3) %!d(string=hai) anos
pai
achega
b6bc3030ca
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      community-contributions/joystreamtelegrambot/src/bot.ts

+ 12 - 1
community-contributions/joystreamtelegrambot/src/bot.ts

@@ -70,7 +70,18 @@ const sendTelegram = (msg: string) => {
 };
 const sendDiscord = (msg: string, channel: any) => {
   if (!channel) return;
-  const stripped: string = stripHtml(msg).result;
+
+  const options = {
+    dumpLinkHrefsNearby: {
+      enabled: false,
+      putOnNewLine: false,
+      wrapHeads: "",
+      wrapTails: "",
+    },
+  };
+
+  const stripped: string = stripHtml(msg, options).result;
+
   if (!stripped.length) return;
   try {
     channel.send(stripped);