Skip to content

Commit d7fa455

Browse files
authored
Merge pull request #90 from Quantum-0/patch-2
Update easter_eggs.js
2 parents 1f688f6 + 12eccb5 commit d7fa455

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

js/easter_eggs.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ const celebrities = [
1313
id: "yui2d",
1414
tags: ["yui2d", "yui", "юй", "юи", "юй2д", "юи2д"],
1515
img: ["yui2d_1.gif", "yui2d_2.avif", "yui2d_3.avif", "yui2d_4.gif", "yui2d_5.png", "yui2d_6.avif"]
16+
},
17+
{
18+
id: "quantum075",
19+
tags: ["quantum0", "quantum", "quantum075", "квантум"],
20+
img: ["https://bot.quantum0.ru/static/images/stickers/1.webp", "https://bot.quantum0.ru/static/images/stickers/2.webp", "https://bot.quantum0.ru/static/images/stickers/3.webp", "https://bot.quantum0.ru/static/images/stickers/4.webp", "https://bot.quantum0.ru/static/images/stickers/5.webp"]
1621
}
1722
];
1823

@@ -24,13 +29,14 @@ function check_easter_egg(input) {
2429
if (celeb) {
2530
const pics = celeb.img.slice(1);
2631
const pic = pics[Math.floor(Math.random() * pics.length)];
32+
const getSrc = (path) => path ? (path.startsWith('http') ? path : `img/${path}`) : '';
2733

2834
const html = `
2935
<div class="msg">
3036
<div class="msg-content">
3137
<div class="iwawwa">
32-
<img src="img/${celeb.img[0]}">
33-
<img src="img/${pic}">
38+
<img src="${getSrc(celeb.img[0])}">
39+
<img src="${getSrc(pic)}">
3440
</div>
3541
</div>
3642
</div>`;
@@ -43,4 +49,4 @@ function check_easter_egg(input) {
4349
}
4450

4551
return false;
46-
}
52+
}

0 commit comments

Comments
 (0)