smort embed.js big thonking 🔥 🔥

This commit is contained in:
2021-09-28 20:39:12 +02:00
parent c2074d6207
commit 36eba7e0f2
5 changed files with 147 additions and 290 deletions

42
src/cmds/embed.js Normal file
View File

@@ -0,0 +1,42 @@
module.exports = {
name: 'embed',
execute(cl, msg, args) {
const embed = {
color: cl.cfg.hexBlue,
timestamp: new Date(),
footer: {
text: `Komenda wywołana przez ${msg.author.tag}`,
icon_url: cl.cfg.iconurl,
},
};
switch (args[0]) {
case 'witaj':
embed.title = 'Witajcie w Gractwie!';
embed.description =
'Jesteśmy grupą ludzi których kręcą gry. Proste, nie?\nSerwer ten miał wcześniej tematykę Team Fortressową.';
embed.footer.text = '#witaj';
embed.fields = cl.cfg.embedFields.witaj;
readyMsg = { embeds: [embed] };
break;
case 'regulamin':
embed.title = 'Regulamin';
embed.description =
'Regulamin naszego serwera składa się z tego, co następuje:';
embed.footer.text = `Ostatnio zaktualizowany`;
embed.fields = cl.cfg.embedFields.regulamin;
readyMsg = { embeds: [embed] };
break;
case 'rolki':
embed.title = 'Rolki';
embed.description = '#rolki jest kanałem do przyznawania sobie ról.';
readyMsg = { embeds: [embed] /*components: [rows]*/ };
break;
default:
embed.title = `zły parametr: ` + args[0];
embed.color = cl.cfg.hexRed;
readyMsg = { embeds: [embed] };
break;
}
msg.channel.send(readyMsg);
},
};

View File

@@ -1,18 +1,18 @@
module.exports = {
name: 'ping',
execute(msg, args, cfg) {
const pingembed = {
color: cfg.hexBlue,
execute(cl, msg) {
const embed = {
color: cl.cfg.hexBlue,
timestamp: new Date(),
footer: {
text: `Komenda wywołana przez ${msg.author.tag}`,
icon_url: cfg.iconurl,
icon_url: cl.cfg.iconurl,
},
title: 'Pong!',
description: `Ping jednostronny wynosi ${
Date.now() - msg.createdTimestamp
}ms.`,
};
msg.channel.send({ embeds: [pingembed] });
msg.channel.send({ embeds: [embed] });
},
};