Files
request-bot/build/lib.js

35 lines
1.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseMessage = void 0;
function parseMessage(message) {
var messageArr = message.slice().split('\n').filter(function (el) { return el !== ''; });
var title = messageArr[1]
.slice()
.split(' ')
.at(-1);
var groupName = messageArr[1]
.slice()
.replace('В АС СТП на Вашу группу Адлер ', '')
.replace(' назначено обращение', '')
.split(' ')
.slice(0, -1)
.join(' ');
var user = messageArr[4];
var subject = messageArr[6];
var estimatedDate = messageArr[7]
.slice()
.split(' ')[3];
var estimatedTime = messageArr[7]
.slice()
.split(' ')[4];
return {
title: title,
groupName: groupName,
user: user,
subject: subject,
estimatedDate: estimatedDate,
estimatedTime: estimatedTime
};
}
exports.parseMessage = parseMessage;