if (caught) {
message.user.balance -= 5000;
return message.reply(` [${['', '', '', '', ''].random()}] Ваша ракета сломалась.\n⚠ ⇢ Вы потеряли: 50.000.000$ `);
} // <<< вы не поставили эту скобку
<div class="post-container"><div><a href="/gag/aP7bePV" data-track="post,p,,,d,aP7bePV,p" class="badge-track" target="_blank" style="min-height: 280px;"><div class="post-view video-post"><video preload="auto" poster="https://img-9gag-fun.9cache.com/photo/aP7bePV_460s.jpg" style="min-height: 280px; width: 500px;" loop="" width="500"><!----><!----><!----><source src="https://img-9gag-fun.9cache.com/photo/aP7bePV_460sv.mp4" type="video/mp4"><!----></video><div class="sound-toggle off"></div><!----><div class="hide"><span class="play">Play</span></div></div></a></div><div class="post-text-container"></div></div>
<div class="post-container"><a data-evt="PostList,TapPost,Funny-Fresh,,PostImage" data-entry-id="aeD8xOW" data-position="2" href="/gag/aeD8xOW" class="badge-evt badge-track" style="min-height: 456.522px;" target="_blank"><picture><source srcset="https://img-9gag-fun.9cache.com/photo/aeD8xOW_460swp.webp" type="image/webp"><img src="https://img-9gag-fun.9cache.com/photo/aeD8xOW_460s.jpg" alt="What the hell is wrong with her" style="min-height: 456.522px;" loading="lazy"></picture></a><!----></div>
<div class="post-container"><div><a href="/gag/a5W0z6N" data-track="post,p,,,d,a5W0z6N,p" class="badge-track" target="_blank" style="min-height: 280.435px;"><div class="post-view video-post"><video preload="auto" poster="https://img-9gag-fun.9cache.com/photo/a5W0z6N_460s.jpg" style="min-height: 280.435px; width: 500px;" loop="" width="500"><!----><!----><source src="https://img-9gag-fun.9cache.com/photo/a5W0z6N_460svvp9.webm" type="video/webm; codecs="vp9, opus""><source src="https://img-9gag-fun.9cache.com/photo/a5W0z6N_460sv.mp4" type="video/mp4"><!----></video><div class="sound-toggle off"></div><!----><div class="hide"><span class="play">Play</span></div></div></a></div><div class="post-text-container"></div></div>
document.querySelector(...)
и document.querySelectorAll(...)
${content.img !== undefined ? "<img src='"+content.img+"' alt=''>":""}
${content.img !== undefined ? "<img src='${ content.img }' alt=''>":""}
условие ? вариант если условие верно : вариант если условие неверно
<code lang="javascript">ваш код</code>
. Если не знаете как это сделать, просто примите правку к вашему вопросу (сделал это за вас) const arr = [
{ id: 1, dateFilters: "01.01.2021", },
{ id: 2, dateFilters: "05.05.2021", },
{ id: 3, dateFilters: "03.03.2020", },
{ id: 4, dateFilters: "12.12.2020", },
{ id: 5, dateFilters: "24.11.2020", },
];
const now = Date.now();
const today = now-now%(1000*60*60*24);
const list = arr.filter(item=>{
const timestamp = Date.parse(item.dateFilters.split(/\./).reverse().join("-"));
if( timestamp>today) return true;
return false;
});
console.log(list);
[
{ "id": 1, "dateFilters": "01.01.2021" },
{ "id": 2, "dateFilters": "05.05.2021" },
{ "id": 4, "dateFilters": "12.12.2020" },
{ "id": 5, "dateFilters": "24.11.2020" }
]
const arr = [
{ id: 1, dateFilters: "01.01.2021", },
{ id: 2, dateFilters: "05.05.2021", },
{ id: 3, dateFilters: "03.03.2020", },
{ id: 4, dateFilters: "12.12.2020", },
{ id: 5, dateFilters: "24.11.2020", },
];
const now = Date.now();
const today = now-now%(1000*60*60*24);
const unsorted = []
const sorted = arr.filter(item=>{
const timestamp = Date.parse(item.dateFilters.split(/\./).reverse().join("-"));
if( timestamp>today) return true;
unsorted.push(item);
return false;
});
sorted.sort((a,b)=>Date.parse(a.dateFilters.split(/\./).reverse().join("-"))-Date.parse(b.dateFilters.split(/\./).reverse().join("-")));
const list = [...unsorted,...sorted];
console.log(list);
[
{ "id": 3, "dateFilters": "03.03.2020" },
{ "id": 5, "dateFilters": "24.11.2020" },
{ "id": 4, "dateFilters": "12.12.2020" },
{ "id": 1, "dateFilters": "01.01.2021" },
{ "id": 2, "dateFilters": "05.05.2021" }
]
const arr = [
{ id: 1, dateFilters: "01.01.2021", },
{ id: 2, dateFilters: "05.05.2021", },
{ id: 3, dateFilters: "03.03.2020", },
{ id: 4, dateFilters: "12.12.2020", },
{ id: 5, dateFilters: "24.11.2020", },
];
const now = Date.now();
const today = now-now%(1000*60*60*24);
const list = [...arr].sort((a,b)=>{
const aTimestamp = Date.parse(a.dateFilters.split(/\./).reverse().join("-"));
const bTimestamp = Date.parse(b.dateFilters.split(/\./).reverse().join("-"));
if(aTimestamp<today && bTimestamp<today) return 0;
return aTimestamp-bTimestamp;
});
console.log(list);
[
{ "id": 3, "dateFilters": "03.03.2020" },
{ "id": 5, "dateFilters": "24.11.2020" },
{ "id": 4, "dateFilters": "12.12.2020" },
{ "id": 1, "dateFilters": "01.01.2021" },
{ "id": 2, "dateFilters": "05.05.2021" }
]
"Abc\@def"@example.com
"Fred Bloggs"@example.com
"Joe\\Blow"@example.com
"Abc@def"@example.com
customer/department=shipping@example.com
\$A12345@example.com
!def!xyz%abc@example.com
_somename@example.com