Linventif
Linventif
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
will see the docs
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
you just made me realise I can multi process
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
yes
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
yup but I can't let 1 user kill a multi user process
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
👍
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
custom bot for a saas, the other solution will be docker with dynamic nginx config
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
import { Client, GatewayIntentBits, Partials } from 'discord.js';

async function testLogin(token) {
try {
const client = new Client({
intents: [
GatewayIntentBits.AutoModerationConfiguration,
GatewayIntentBits.AutoModerationExecution,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildModeration,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.Guilds,
GatewayIntentBits.MessageContent,
GatewayIntentBits.DirectMessages,
],
partials: [Partials.Channel],
});

await client.login(token);
client.destroy();
process.send('OK');
} catch (error) {
console.error('Login failed:', error);
process.exit(1);
}
}

process.on('message', (token) => {
testLogin(token);
});
import { Client, GatewayIntentBits, Partials } from 'discord.js';

async function testLogin(token) {
try {
const client = new Client({
intents: [
GatewayIntentBits.AutoModerationConfiguration,
GatewayIntentBits.AutoModerationExecution,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildModeration,
GatewayIntentBits.GuildScheduledEvents,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.Guilds,
GatewayIntentBits.MessageContent,
GatewayIntentBits.DirectMessages,
],
partials: [Partials.Channel],
});

await client.login(token);
client.destroy();
process.send('OK');
} catch (error) {
console.error('Login failed:', error);
process.exit(1);
}
}

process.on('message', (token) => {
testLogin(token);
});
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
async function checkTokenAndIntents(token) {
return new Promise((resolve, reject) => {
const child = fork(path.join(__dirname, 'testLogin.js'));

child.on('message', (message) => {
if (message === 'OK') {
resolve(true);
}
});

child.on('exit', (code) => {
if (code !== 0) {
resolve(false);
}
});

child.send(token);
});
}
async function checkTokenAndIntents(token) {
return new Promise((resolve, reject) => {
const child = fork(path.join(__dirname, 'testLogin.js'));

child.on('message', (message) => {
if (message === 'OK') {
resolve(true);
}
});

child.on('exit', (code) => {
if (code !== 0) {
resolve(false);
}
});

child.send(token);
});
}
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
yup I did it
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
ok I think I have a idea with child process than
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
so no way to catch it ?
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
actually it just block my code
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
but I want to catch the error
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
yup I know
25 replies
DIAdiscord.js - Imagine an app
Created by Linventif on 7/11/2024 in #djs-questions
Unable to catch the disalowed intent
No description
25 replies