Nixxxxxx
Nixxxxxx
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
Is there any other options to adjust in the future regards to this? Would be nice if there could be a way to just only set retries count on the uploading message part.
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 7/24/2023 in #djs-questions
Hyperlink mask as a chat message works in certain servers?
What would be the best way to try to keep the embedded video to show on discord with a URL being so long? Checked on discord, says it wouldn't do a video auto embed with a URL, would I just have to upload it as a file?
10 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 7/24/2023 in #djs-questions
Hyperlink mask as a chat message works in certain servers?
10 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 7/24/2023 in #djs-questions
Hyperlink mask as a chat message works in certain servers?
10 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
Any tags I can apply to the send message request to only try once?
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
RequestAbortedError [AbortError]: Request aborted
at RequestHandler.abort (C:\Users\nicen\Downloads\InstagramBot2\node_modules\undici\lib\client.js:1391:44)
at abort (C:\Users\nicen\Downloads\InstagramBot2\node_modules\undici\lib\api\abort-signal.js:8:10)
at AbortSignal.self.<computed> (C:\Users\nicen\Downloads\InstagramBot2\node_modules\undici\lib\api\abort-signal.js:29:5)
at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
at AbortSignal.dispatchEvent (node:internal/event_target:589:26)
at abortSignal (node:internal/abort_controller:283:10)
at AbortController.abort (node:internal/abort_controller:314:5)
at Timeout.<anonymous> (C:\Users\nicen\Downloads\InstagramBot2\node_modules\@discordjs\rest\dist\index.js:589:71)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_ABORTED'
}
RequestAbortedError [AbortError]: Request aborted
at RequestHandler.abort (C:\Users\nicen\Downloads\InstagramBot2\node_modules\undici\lib\client.js:1391:44)
at abort (C:\Users\nicen\Downloads\InstagramBot2\node_modules\undici\lib\api\abort-signal.js:8:10)
at AbortSignal.self.<computed> (C:\Users\nicen\Downloads\InstagramBot2\node_modules\undici\lib\api\abort-signal.js:29:5)
at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:647:20)
at AbortSignal.dispatchEvent (node:internal/event_target:589:26)
at abortSignal (node:internal/abort_controller:283:10)
at AbortController.abort (node:internal/abort_controller:314:5)
at Timeout.<anonymous> (C:\Users\nicen\Downloads\InstagramBot2\node_modules\@discordjs\rest\dist\index.js:589:71)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_ABORTED'
}
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
it never prints 'end' anymore.
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
worked just fine till tonight, bot would only post once and be alright.
client.on('messageCreate', message => {
if (message.author.bot) return;
if (message.channel.type === 'DM') return;

let url = message.content.match(/https?:\/\/[^\s]+/);
if (url && url[0]) {
//console.log(message);
console.log("url0 exists!");
url=url[0]
if (url.includes("instagram.com")/* || url.includes("facebook.com/reel/")*/) {
const child_process = require('child_process');
var exe = 'gallery-dl.exe --cookies "'+url+'"';
if (url.includes("instagram.com")) {
exe = 'gallery-dl.exe --cookies ".\\www.instagram.com_cookies.txt" "'+url+'"'
};
if (url.includes("facebook.com/reel/")) {
exe = 'gallery-dl.exe --cookies ".\\www.facebook.com_cookies.txt" "'+url+'"'
};
const args = [];
console.log(args);
child_process.exec(exe, args, (err, stdout, stderr) => {
if (err) {
console.log(err);
try{
message.react("❌");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
} else {
var filepath = stdout.slice(2,-2);
console.log("---");
console.log("|-" + filepath + "-|");
console.log("---");
if(fs.existsSync(filepath)){
console.log("yay downloaded and exists! UPLOAD");
try{
message.react("✅");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
console.log("file exists, sending message!");
message.channel.send({
content: ':wave:',
files: [{
attachment: filepath
}]
})
.then(msg => {
console.log("end");
lmsg.delete();
})
.catch(console.error);
} else {
try{
message.react("⚠️");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
console.log("error");
}
}
});
}
}
});
client.on('messageCreate', message => {
if (message.author.bot) return;
if (message.channel.type === 'DM') return;

let url = message.content.match(/https?:\/\/[^\s]+/);
if (url && url[0]) {
//console.log(message);
console.log("url0 exists!");
url=url[0]
if (url.includes("instagram.com")/* || url.includes("facebook.com/reel/")*/) {
const child_process = require('child_process');
var exe = 'gallery-dl.exe --cookies "'+url+'"';
if (url.includes("instagram.com")) {
exe = 'gallery-dl.exe --cookies ".\\www.instagram.com_cookies.txt" "'+url+'"'
};
if (url.includes("facebook.com/reel/")) {
exe = 'gallery-dl.exe --cookies ".\\www.facebook.com_cookies.txt" "'+url+'"'
};
const args = [];
console.log(args);
child_process.exec(exe, args, (err, stdout, stderr) => {
if (err) {
console.log(err);
try{
message.react("❌");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
} else {
var filepath = stdout.slice(2,-2);
console.log("---");
console.log("|-" + filepath + "-|");
console.log("---");
if(fs.existsSync(filepath)){
console.log("yay downloaded and exists! UPLOAD");
try{
message.react("✅");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
console.log("file exists, sending message!");
message.channel.send({
content: ':wave:',
files: [{
attachment: filepath
}]
})
.then(msg => {
console.log("end");
lmsg.delete();
})
.catch(console.error);
} else {
try{
message.react("⚠️");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
console.log("error");
}
}
});
}
}
});
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
my only idea is discord.js thinks the file upload failed, and tries again...
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
client.on('messageCreate', message => {
if (message.author.bot) return;
if (message.channel.type === 'DM') return;
client.on('messageCreate', message => {
if (message.author.bot) return;
if (message.channel.type === 'DM') return;
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
the bot never chats a url, and if it was to trigger the event again, the console log should show 'yay downloaded' and 'file exists' again.
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
when someone posts a instagram url, the bot would grab that url. The bot only logs the 'yay downloaded' and 'file exists' once, but it seems to upload the file over and over.
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
For some reason, this is uploading again, and again, until I kill the bot. The media is uploading, probably the bot 'retrying' again?
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
console.log("yay downloaded and exists! UPLOAD");
try{
message.react("✅");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
console.log("file exists, sending message!");
message.channel.send({
files: [{
attachment: filepath
}]
})
.then(msg => {
console.log("end");
lmsg.delete();
})
.catch(console.error);
console.log("yay downloaded and exists! UPLOAD");
try{
message.react("✅");
message.suppressEmbeds(true)
} catch (err) {
console.log(err)
};
console.log("file exists, sending message!");
message.channel.send({
files: [{
attachment: filepath
}]
})
.then(msg => {
console.log("end");
lmsg.delete();
})
.catch(console.error);
21 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Nixxxxxx on 6/28/2023 in #djs-questions
Bot seems to be uploading the same media file multiple times?
`-- [email protected] node v16.14.0
21 replies