From a1d0782a83f8163e301c8beefa3fa2b7a297b473 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 24 Dec 2019 19:55:38 +0100 Subject: [PATCH] use turndown --- commands/fun/4chan.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/fun/4chan.js b/commands/fun/4chan.js index c9502e8..f72c5fe 100644 --- a/commands/fun/4chan.js +++ b/commands/fun/4chan.js @@ -1,7 +1,8 @@ const { Command } = require('discord-akairo'); const fetch = require('node-fetch'); const boards = require('4chan-boards'); -const htmlToText = require('html-to-text'); +const Turndown = require('turndown'); +let turndown = new Turndown(); class FourchanCommand extends Command { constructor() { @@ -70,8 +71,8 @@ class FourchanCommand extends Command { const FourchanEmbed = this.client.util.embed() .setColor(message.member.displayHexColor) - .setTitle(title) - .setDescription(htmlToText.fromString(description)) + .setTitle(turndown.turndown(title)) + .setDescription(turndown.turndown(description)) .setImage(`https://i.4cdn.org/${args.board}/${response.threads[i].posts[0].tim}${response.threads[i].posts[0].ext}`) .setURL(`https://boards.4chan.org/${args.board}/thread/${response.threads[i].posts[0].no}/${response.threads[i].posts[0].semantic_url}`) .setFooter(`${boardName} | ${response.threads[i].posts[0].name} | ${response.threads[i].posts[0].no} | ${response.threads[i].posts[0].now}`);