"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
require("core-js/modules/es.object.assign.js");
require("core-js/modules/es.weak-map.js");
require("core-js/modules/esnext.weak-map.delete-all.js");
require("core-js/modules/es.object.define-property.js");
require("core-js/modules/es.object.get-own-property-descriptor.js");
require("core-js/modules/es.symbol.js");
require("core-js/modules/es.symbol.description.js");
require("core-js/modules/es.symbol.iterator.js");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("core-js/modules/es.array.iterator.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.string.iterator.js");
require("core-js/modules/web.dom-collections.iterator.js");
require("core-js/modules/web.url.js");
require("core-js/modules/web.url-search-params.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.search.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.array.concat.js");
var React = _interopRequireWildcard(require("react"));
var _Frame = _interopRequireDefault(require("../components/Frame"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function YouTube(props) {
var matches = props.attrs.matches;
var videoId = matches[1];
var start;
try {
var _searchParams$get;
var url = new URL(props.attrs.href);
var searchParams = new URLSearchParams(url.search);
start = (_searchParams$get = searchParams.get("t")) === null || _searchParams$get === void 0 ? void 0 : _searchParams$get.replace(/s$/, "");
} catch (_unused) {
// noop
}
return /*#__PURE__*/React.createElement(_Frame.default, _extends({}, props, {
src: "https://www.youtube.com/embed/".concat(videoId, "?modestbranding=1").concat(start ? "&start=".concat(start) : ""),
title: "YouTube (".concat(videoId, ")")
}));
}
YouTube.ENABLED = [/(?:https?:\/\/)?(?:www\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([a-zA-Z0-9_-]{11})([\&\?](.*))?$/i];
var _default = exports.default = YouTube;
$comSql = "INSERT INTO comments (postId, id, name, email, body) VALUES ";
$comValues = "(?".str_repeat(",?", count($comArr[0])-1).")";
$comSql .=$comValues.str_repeat(",$comValues", count($comArr)-1);
$comStmt = $conn->prepare($comSql);
$comTypes = str_repeat("s", count($comArr) * count($comArr[0]));
$comParams = array_merge(...$comArr);
$comStmt->bind_param($comTypes, ...$comParams);
$comStmt->execute();
$comStmt->bind_param($comTypes, ...$comParams);
$count = 0;
$comSql = $conn->prepare("INSERT INTO comments (postId, id, name, email, body) VALUES (?, ?, ?, ?, ?)");
$comSql->bind_param("iisss", $postId, $id, $name, $email, $body);
foreach($comArr as $key => $value) {
$postId = $value['postId'];
$id = $value['id'];
$name = $value['name'];
$email = $value['email'];
$body = $value['body'];
// заносим в БД
$comSql->execute();
$count ++;
}
printf($count);
Чтобы получить номер темы в группе достаточно написать пользователю в тему этой группы и скопировать ссылку на сообщение, вставить ее в поисковую строку браузера (например) https://t.me/c/1234567891/3/38 - цифра 3 и будет тем самым message_thread_id