Uncaught TypeError: Cannot set property 'onclick' of nul
chat_hello_message
. chat_hello_message
document.getElementById('chat-hello-message').onclick = function () {
chat_hello_message.style.display = 'none';
setTimeout(function () {
chat_hello_message.innerHTML = "";
}, 2000);
}
if (mess.member.voice.channel) {
async function play(voiceChannel) {
const connection = await mess.member.voice.channel.join()
connection.play('hello.mp3');
}
}
if (!mess.member.voice.channel && mess.content === `${prefix}start`) {
mess.channel.send(':warning: **Join the voice channel**');
play();
}
if (mess.guild.me.voice.channel && mess.content === `${prefix}start`) {
mess.channel.send(':warning: **I am already connected to the voice channel**')
function getK() {
$.ajax({
url: '/index.php?route=create_order/OrderNew/getK',
dataType: 'json',
type: 'post',
data: $('[name="time"').serialize(), // возвращаемая k зависит от времени
success: function (resp) {
calc(resp);
}
});
}
function calc(someValue){
return someValue*100;
}
getK();
Пытался копаться в документации, но ничего не понятно.
let globalDataAdmin = null;
io.on('connection', (socket) => {
console.log('Socket Run...')
// ToDo ZONE
socket.on('dataPush', (dataAdmin) => {
// Query to DB
fs.writeFileSync('data.json', JSON.stringify(dataAdmin));
console.log('Data writing to DB');
var dataIndex = fs.readFileSync('data.json');
io.emit('dataPull', dataAdmin);
sendNotification(message);
globalDataAdmin = dataAdmin;
});
// Send sms
return function returnDay(){
socket.on('chat message', (msg) => {
let sql = `INSERT INTO messages (id, text) VALUES (NULL, '${msg}')`;
db.query(sql, (err, result) => {
if (err) throw err;
console.log('SMS adding to DB...');
})
io.emit('chat message', msg);
});
}
// Disconnect
socket.on('disconnect', () => {
console.log('Socket STOP!');
});
});
console.log(returnDay());
console.log('Global Data Admin:',globalDataAdmin);