filmov
tv
Обновляемая память (Discord.js V13) #4 (Устарело см. описание)
Показать описание
В этом видео есть "проглатываемые" моменты из-за ошибки кодировщика бандикам. Но не смотря на это в этом видео я рассказываю и показываю как сделать обновляемую память бота!
Код обновлятеля:
for(let key in serv) { //Проходимся по ключам
if(key !== "members") {
if(origin[key] === undefined) origin[key] = serv[key]; //Если ключа нет - создать
if(isObject(serv[key])) {
for(let keyT2 in serv[key]) {
if(origin[key][keyT2] === undefined) origin[key][keyT2] = serv[key][keyT2];
if(isObject(serv[key][keyT2])) {
for(let keyT3 in serv[key][keyT2]) {
if(origin[key][keyT2][keyT3] === undefined) origin[key][keyT2][keyT3] = serv[key][keyT2][keyT3];
}
}
}
}
}
}
for(let key in origin) {
if(key !== "members") {
if(serv[key] === undefined) delete origin[key];
if(isObject(origin[key])) {
for(let keyT2 in origin[key]) {
if(serv[key][keyT2] === undefined) delete origin[key][keyT2];
if(isObject(origin[key][keyT2])) {
for(let keyT3 in origin[key][keyT2]) {
if(serv[key][keyT2][keyT3] === undefined) delete origin[key][keyT2][keyT3];
}
}
}
}
}
}
for(let key in member) {
if(memberUser[key] === undefined) memberUser[key] = member[key];
if(isObject(member[key])) {
for(let keyT2 in member[key]) {
if(memberUser[key][keyT2] === undefined) memberUser[key][keyT2] = member[key][keyT2];
if(isObject(member[key][keyT2])) {
for(let keyT3 in member[key][keyT2]) {
if(memberUser[key][keyT2][keyT3] === undefined) memberUser[key][keyT2][keyT3] = member[key][keyT2][keyT3];
}
}
}
}
}
}
}
for(let key in user) {
if(origin[key] === undefined) origin[key] = user[key];
if(isObject(user[key])) {
for(let keyT2 in user[key]) {
if(origin[key][keyT2] === undefined) origin[key][keyT2] = user[key][keyT2];
}
}
}
for(let key in origin) {
if(user[key] === undefined) delete origin[key]; else
if(isObject(origin[key])) {
for(let keyT2 in origin[key]) {
if(user[key][keyT2] === undefined) delete origin[key][keyT2];
}
}
}
}
(Код в видео не совсем правильный)
Код обновлятеля:
for(let key in serv) { //Проходимся по ключам
if(key !== "members") {
if(origin[key] === undefined) origin[key] = serv[key]; //Если ключа нет - создать
if(isObject(serv[key])) {
for(let keyT2 in serv[key]) {
if(origin[key][keyT2] === undefined) origin[key][keyT2] = serv[key][keyT2];
if(isObject(serv[key][keyT2])) {
for(let keyT3 in serv[key][keyT2]) {
if(origin[key][keyT2][keyT3] === undefined) origin[key][keyT2][keyT3] = serv[key][keyT2][keyT3];
}
}
}
}
}
}
for(let key in origin) {
if(key !== "members") {
if(serv[key] === undefined) delete origin[key];
if(isObject(origin[key])) {
for(let keyT2 in origin[key]) {
if(serv[key][keyT2] === undefined) delete origin[key][keyT2];
if(isObject(origin[key][keyT2])) {
for(let keyT3 in origin[key][keyT2]) {
if(serv[key][keyT2][keyT3] === undefined) delete origin[key][keyT2][keyT3];
}
}
}
}
}
}
for(let key in member) {
if(memberUser[key] === undefined) memberUser[key] = member[key];
if(isObject(member[key])) {
for(let keyT2 in member[key]) {
if(memberUser[key][keyT2] === undefined) memberUser[key][keyT2] = member[key][keyT2];
if(isObject(member[key][keyT2])) {
for(let keyT3 in member[key][keyT2]) {
if(memberUser[key][keyT2][keyT3] === undefined) memberUser[key][keyT2][keyT3] = member[key][keyT2][keyT3];
}
}
}
}
}
}
}
for(let key in user) {
if(origin[key] === undefined) origin[key] = user[key];
if(isObject(user[key])) {
for(let keyT2 in user[key]) {
if(origin[key][keyT2] === undefined) origin[key][keyT2] = user[key][keyT2];
}
}
}
for(let key in origin) {
if(user[key] === undefined) delete origin[key]; else
if(isObject(origin[key])) {
for(let keyT2 in origin[key]) {
if(user[key][keyT2] === undefined) delete origin[key][keyT2];
}
}
}
}
(Код в видео не совсем правильный)
Комментарии