Skip to content

Commit

Permalink
🔊 log accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivien Mouret committed Jul 16, 2024
1 parent acaaafb commit 302468b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions command/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
desc = '',
descSplit = '',
lang = '';
console.log(`[${getCurrentDatetime('comm')}] GUIDOT HELP ${guidDot}`);

await new Promise(resolve => setTimeout(resolve, 2.5 * 1000)); // 2.5 secondes

Expand Down Expand Up @@ -52,10 +53,12 @@ module.exports = {
return console.log(`[${getCurrentDatetime('comm')}] Error function help() GUID [${guidDot}]`);
} else if (guidDot != undefined && guidDot.data != undefined) {
guid = guidDot.data.split(new RegExp(`(s\/[^.]*-p)`, 'giu'))[1];
console.log(`[${getCurrentDatetime('comm')}] GUID ${guid}`);
guid = guid.split('s/')[1].split('-p')[0];
console.log(`[${getCurrentDatetime('comm')}] GUID ${guid}`);

dot = guidDot.data.split(new RegExp(`(ge-[.]*...........)`, 'giu'))[1];
console.log(`[${getCurrentDatetime('comm')}] DOT ${dot}`);
dot = dot.split('.')[1].split(' ')[0];
console.log(`[${getCurrentDatetime('comm')}] DOT ${dot}`);
};
Expand Down
7 changes: 3 additions & 4 deletions core/daftbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class DaftBot {
checkLive = false;
console.log(`[${getCurrentDatetime('comm')}] Error GET AXIOS ${err}`);
});
console.log(`[${getCurrentDatetime('comm')}] AXIOS HELIX STREAMS ${ax}`);
console.log(`[${getCurrentDatetime('comm')}] AXIOS WHILEDAFT ${ax.data.data[0].game_name}`);

if (ax == undefined) { continue; };

Expand All @@ -208,7 +208,7 @@ class DaftBot {
if (this.dbClient.user.id == this.avoidBot[1]) { continue; };
let guiDot = await axios.get(`https://twitch.tv/${ax.data.data[0].user_login}`);
await new Promise(resolve => setTimeout(resolve, 2.5 * 1000)); // 2.5 secondes
console.log(`[${getCurrentDatetime('comm')}] GUIDOT TWITCH ${guiDot}`);
console.log(`[${getCurrentDatetime('comm')}] GUIDOT TWITCH ${guiDot.data}`);
this.dbClient.mobbot
.get('livenotif')
.execute(message, this.dbClient, this.language, guiDot.data, ax);
Expand All @@ -219,15 +219,14 @@ class DaftBot {
let fe = await fetch(`https://www.youtube.com/feeds/videos.xml?channel_id=UCreItrEewfO6IPZYPu4C7pA`)
.catch(err => { console.log(`[${getCurrentDatetime('comm')}] Error FETCH ${err}`); });
if (fe == undefined) { continue; };
console.log(`[${getCurrentDatetime('comm')}] YOUTUBE FETCH ${fe}`);

let fetched = await fe.text(),
published = fetched.split(new RegExp(`(\>[^.]*?\/)`, 'giu'))[37];

if (published == undefined) { continue; };
console.log(`[${getCurrentDatetime('comm')}] SLICE ${published}`);

let sliced = published.slice(15, -2),
let sliced = published.slice(13, -2),
pubDate = new Date(sliced);
console.log(`[${getCurrentDatetime('comm')}] DATE PUBLICATION YTB ${pubDate}`);

Expand Down
4 changes: 3 additions & 1 deletion core/mobbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class MobBot {
});

if (ax == undefined) { break; };
console.log(`[${getCurrentDatetime('comm')}] AXIOS HELIX STREAMS ${ax}`);
console.log(`[${getCurrentDatetime('comm')}] AXIOS WHILEMOB ${ax.data.data[0].game_name}`);

if (!checkLive || ax.data.data.length == 0) {
gameMemory = '';
Expand Down Expand Up @@ -371,10 +371,12 @@ class MobBot {
return console.log(`[${getCurrentDatetime('comm')}] Error function liveNotif() GUID [${gD}]`);
} else if (gD != undefined) {
guid = gD.split(new RegExp(`(s\/[^.]*-p)`, 'giu'))[1];
console.log(`[${getCurrentDatetime('comm')}] GUID ${guid}`);
guid = guid.split('s/')[1].split('-p')[0];
console.log(`[${getCurrentDatetime('comm')}] GUID ${guid}`);

dot = gD.split(new RegExp(`(ge-[.]*...........)`, 'giu'))[1];
console.log(`[${getCurrentDatetime('comm')}] DOT ${dot}`);
dot = dot.split('.')[1].split(' ')[0];
console.log(`[${getCurrentDatetime('comm')}] DOT ${dot}`);
};
Expand Down

0 comments on commit 302468b

Please sign in to comment.