@@ -27,6 +27,7 @@
"discord.js": "^12.5.3",
"moment": "^2.29.1",
"node-telegram-bot-api": "^0.51.0",
+ "string-strip-html": "^8.3.0",
"ws": "^7.4.1"
},
"devDependencies": {
@@ -8,6 +8,7 @@ import {
proposalDelay,
wsLocation,
} from "../config";
+import { stripHtml } from "string-strip-html";
// types
import { Block, Council, Options, Proposals } from "./types";
@@ -69,8 +70,10 @@ const sendTelegram = (msg: string) => {
};
const sendDiscord = (msg: string, channel: any) => {
if (!channel) return;
+ const stripped: string = stripHtml(msg).result;
+ if (!stripped.length) return;
try {
- channel.send(msg);
+ channel.send(stripped);
} catch (e) {
console.log(e);
}