You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tellme-bot/packages/server/parsers/text.js

28 lines
542 B

10 months ago
import Parser from './_parser.js'
import DOMPurify from 'isomorphic-dompurify'
2 years ago
/**
* Parser for "text" in Json, is used by slack
*
2 years ago
* @author Björn Hase
2 years ago
* @license hhttps://www.gnu.org/licenses/gpl-3.0.en.html GPL-3
2 years ago
* @link https://gitea.node001.net/HerrHase/tellme-bot.git
2 years ago
*
*/
10 months ago
class Text extends Parser {
/**
*
*
*/
parse() {
2 years ago
// check for msg and clean it
if (this.body.text) {
this.message = DOMPurify.sanitize(this.body.text)
}
}
}
10 months ago
export default Text