Skip to content

Commit e197d9b

Browse files
author
Vivien Mouret
committed
🐛 dot fix
1 parent 7a87c6d commit e197d9b

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

main.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ const packageVersion = require('./package.json'),
1010
{
1111
prefix,
1212
token,
13-
owner,
14-
openAI
13+
owner
1514
} = require('./config.json'),
1615
{
1716
clientId,
@@ -151,7 +150,7 @@ dbClient.on(Events.ClientReady, async () => {
151150
status: 'online'
152151
});
153152

154-
if (dbClient.user.id == '758393470024155186') return;
153+
// if (dbClient.user.id == '758393470024155186') return;
155154

156155
let descpMemory = [],
157156
oldDescpMemory = [];
@@ -521,13 +520,24 @@ async function processMobBot(message, state) {
521520
};
522521

523522
async function sendLiveNotifEmbed(ax) {
524-
let guidDot = await axios.get(`https://twitch.tv/${ax.data.data[0].user_login}`);
523+
let guidDot = await axios.get(`https://twitch.tv/${ax.data.data[0].user_login}`),
524+
guid = '',
525+
dot = '';
525526

526-
let guid = guidDot.data.split(new RegExp(`(s\/[^.]*-p)`, 'giu'))[1];
527-
guid = guid.split('s/')[1].split('-p')[0];
527+
try {
528+
guid = guidDot.data.split(new RegExp(`(s\/[^.]*-p)`, 'giu'))[1];
529+
guid = guid.split('s/')[1].split('-p')[0];
528530

529-
let dot = guidDot.data.split(new RegExp(`(ge-[.]*...........)`, 'giu'))[1];
530-
dot = dot.split('.')[1].split(' ')[0];
531+
dot = guidDot.data.split(new RegExp(`(ge-[.]*...........)`, 'giu'))[1];
532+
dot = dot.split('.')[1].split(' ')[0];
533+
} catch (err) {
534+
console.log(`[${getCurrentDatetime('comm')}] # Can't get guid and dot : `, err);
535+
};
536+
537+
if (guid == undefined || dot == undefined) {
538+
guid = 0;
539+
dot = 0;
540+
}
531541

532542
for (chan in channelTwitch) {
533543
var channelSend = dbClient.channels.cache.find(channel => channel.name == channelTwitch[chan]);

0 commit comments

Comments
 (0)