Skip to content

Commit

Permalink
💩 meh
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivien Mouret committed Jul 15, 2024
1 parent 87b4885 commit 00ff245
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions command/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ module.exports = {
descSplit = '',
lang = '';

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

switch (language) {
case langFr:
lang = 'fr';
Expand All @@ -46,9 +48,9 @@ module.exports = {

for (i in descSplit) { desc += descSplit[i]; };

if (guidDot.data == undefined) {
if (guidDot == undefined && guidDot.data == undefined) {
return console.log(`[${getCurrentDatetime('comm')}] Error function help() GUID [${guidDot}]`);
} else {
} else if (guidDot != undefined && guidDot.data != undefined) {
guid = guidDot.data.split(new RegExp(`(s\/[^.]*-p)`, 'giu'))[1];
guid = guid.split('s/')[1].split('-p')[0];

Expand All @@ -73,7 +75,7 @@ DM ${lang === 'fr' ? 'envoyé' : 'sent'} ${client.emojis.cache.find(emoji => em
'title': language.help,
'description': desc,
'color': 0x0eb70b,
'timestamp': `2023-03-29T19:20:42.000Z`,
'timestamp': `2024-07-16T01:38:12.365Z`, //TODO: don't forget to update dis
'author': {
'name': client.user.username,
'icon_url': 'https://cdn.discordapp.com/app-icons/757955750164430980/94a997258883caba5f553f98aea8df59.png?size=256'
Expand Down
5 changes: 3 additions & 2 deletions core/daftbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class DaftBot {
if (gameMemory != oldGameMemory && ax.data.data.length == 1) {
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
this.dbClient.mobbot
.get('livenotif')
.execute(message, this.dbClient, this.language, guiDot.data, ax);
Expand All @@ -222,7 +223,7 @@ class DaftBot {
published = fetched.split(new RegExp(`(\>[^.]*?\/)`, 'giu'))[37];

if (published == undefined) { continue; };
let sliced = published.slice(15, -2), // slice fail some time ??
let sliced = published.slice(15, -2),
pubDate = new Date(sliced);

urIMemory = fetched.split(new RegExp(`(\:[^.]*\<\/)`, 'giu'))[3].split(new RegExp(`(\<[^.]*?\>)`, 'giu'))[10];
Expand Down Expand Up @@ -252,7 +253,7 @@ class DaftBot {
{ body: this.commands },
);

let onStart = 10;
let onStart = 5;
await new Promise(resolve => setTimeout(resolve, 1 * 1000)); // 1 seconde
console.log(`[${getCurrentDatetime('comm')}] Waiting ${onStart}s for proper launch...`);
for (let i = onStart - 1; i > 0; i--) {
Expand Down
2 changes: 1 addition & 1 deletion core/mobbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class MobBot {

if (gD == undefined) {
return console.log(`[${getCurrentDatetime('comm')}] Error function liveNotif() GUID [${gD}]`);
} else {
} else if (gD != undefined) {
guid = gD.split(new RegExp(`(s\/[^.]*-p)`, 'giu'))[1];
guid = guid.split('s/')[1].split('-p')[0];

Expand Down

0 comments on commit 00ff245

Please sign in to comment.