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/parser.js

38 lines
685 B

3 years ago
/**
* Basic Class for Parsering Body from Webhook,
* extends Class need to write a parse function and add result to message variable
3 years ago
*
3 years ago
* @author Björn Hase
* @license hhttps://www.gnu.org/licenses/gpl-3.0.en.html GPL-3
3 years ago
* @link https://gitea.node001.net/HerrHase/tellme-bot.git
3 years ago
*
*/
1 year ago
class Parser {
3 years ago
/**
*
*
*/
1 year ago
constructor(body) {
3 years ago
// body from webhook
this.body = body
// message
this.message = undefined
}
/**
* run parser, call parse-function and return message
*
* @return string
*
*/
1 year ago
run() {
3 years ago
this.parse()
return this.message
}
}
1 year ago
export default Parser