let prefix = '!';
let currencySymbol = '@';
discordBot.on('message', (msg) => {
let [ command, ...args ] = msg.content.split(' ');
switch(true) {
case(command === `{ $prefix }set-prefix`):
prefix = args[0] ?? prefix;
break;
case(command === `{ $prefix }set-currency`):
currencySymbol = args[0] ?? currencySymbol;
break;
default: break;
};
});
let prefix = '!';
let currencySymbol = '@';
discordBot.on('message', (msg) => {
let [ command, ...args ] = msg.content.split(' ');
switch(true) {
case(command === `{ $prefix }set-prefix`):
prefix = args[0] ?? prefix;
break;
case(command === `{ $prefix }set-currency`):
currencySymbol = args[0] ?? currencySymbol;
break;
default: break;
};
});
window.addEventListener("hashchange", (e) => {
document.querySelectorAll('.lang > a').forEach(el = el.classList.remove('active'));
switch(location.hash) {
case '#en': document.getElementById('lang-en').classList.add('active'); break;
case '#fr': document.getElementById('lang-fr').classList.add('active'); break;
default: break;
};
}, false);
Hook.send('<@!477815449195642891>', {
embeds: [
{
color: '#fc0303',
title: `Some title`,
description: `Some description`,
url: `http://some.url/`,
thumbnail: {
url: `http://right-image-preview.com/1.png`,
},
image: {
url: `http://full-image.com/2.png`,
},
fields: [
{
name: `Field 1`,
value: `Field 1 text`,
inline: true,
},
{
name: `Field 2`,
value: `Field 2 text`,
inline: true,
},
]
},
],
}).then(m => '').catch((e) => '');
// Сортируем
rootEl.insertBefore(dragEl, target.previousElementSibling ? target.nextElementSibling : target );