a = {
"room": {
"80-c4-48-84-79": " Federal research and production center ",
"73-b3-49-af-9d": " dgru",
"04-d2-45-86-6a": "Main",
"d0-51-41-bf-4f": " Publications",
"c5-3c-4d-83-4f": " news",
"7d-ae-46-a0-25": "Contacts",
"8f-01-4b-81-4e": "Certification center",
"56-32-40-82-1a": "1959",
"27-63-47-b9-1c": "2019",
"a7-34-46-b8-38": " Moscow",
"42-29-4c-bb-df": " text",
"67-8b-47-b1-34": "example"
}
}
d = new Map(Object.keys(a.room).map(x=>[x, a.room[x]]))
var remap = x=>new Map(Object.keys(x).map(y=>[y,(typeof(x[y])=="object")?remap(x[y]):x[y]]))
var audio = new Audio();
audio.src = "http://mus.com/song.mp3";
audio.play();
var lirycs = [{
"time": 5444,
"duration": 121,
"text": "Top ",
"isLineEnding": 0
},
{
"time": 6000,
"duration": 121,
"text": "Top2 ",
"isLineEnding": 0
}];
var next_text = lirycs.shift();
var checker = setInterval(function(){
if(next_text.time<audio.currentTime*1000){
console.log(next_text.text);
next_text = lirycs.shift();
}
if(audio.ended)clearInterval(checker);
});
getResource = async () => await fetch("/pos",
{
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
method: "POST",
body: '{"names":"NeiroN"}'
}).then(function(res){
if (!res.ok) throw Error(`is not ok: ${res.status}`);
//detect json
if(res.headers.get("Content-Type").includes("json")){
return res.json();
}else{
return res.text();
}
}).catch(function(res){
//Errors
console.log(res);
//returned if errors
return "Error!";
});
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'setnick') {
for(user in message.channel.members)if(user.id == args[0])user.setNickname(args[1]);
}
// other commands...
});