function waitElements(selector, regexp, where) {
return new Promise(function(returnResult) {
var search_result = false;
var local_reactive_function = function() {
var wait_elements = searchElements(selector, regexp, where);
if (wait_elements.length > 0) {
if (search_result === false) {
search_result = true;
observer.disconnect();
returnResult(wait_elements);
}
}
}
var observer = new MutationObserver(local_reactive_function);
observer.observe(document.body, {
characterData: true,
attributes: true,
childList: true,
subtree: true
});
local_reactive_function();
});
}
function searchElements(selector, regexp, where) {
var search_elements = [];
if (typeof where !== 'undefined') {
var all_elements = where.querySelectorAll(selector);
}
else {
var all_elements = document.querySelectorAll(selector);
}
for (var n = 0; n < all_elements.length; n++) {
if (typeof regexp == 'object') {
if (typeof regexp.test == 'function') {
if (regexp.test(all_elements[n].innerText.trim())) {
search_elements.push(all_elements[n]);
}
}
}
else {
search_elements.push(all_elements[n]);
}
}
return search_elements;
}
elements = await waitElements('.class');
console.log('Элементы успешно найдены:');
console.dir(elements);
update_types=['edited_message']
@bot.middleware_handler(update_types=['edited_message'])
def foo(bot_instanse, message):
print(message)
ffmpeg \
-i 320.jpg -i 180.jpg -i 360.jpg -i 540.jpg \
-filter_complex vstack=inputs=4 \
output.jpg
-i имяфайла
. А при выделении в Finder'е в каком-то нужном порядке и перетаскивании в Terminal, порядок собъётся на алфавитный.Сreating games
if count != 20:
await message.answer(text)
text = ""
for i in response:
text += f"{i['id']} | {i['name']} | {i['type']} \n"
count += 1
if count == 20:
await message.answer(text)
count = 0
time.sleep(5)
if count != 20:
await message.answer(text)
text = ""
if count != 0:
await message.answer(text)