probablyraging
probablyraging
DIAdiscord.js - Imagine an app
Created by vizzielli on 3/19/2024 in #djs-questions
14.14.1 get deleted thread infos
You can check the Audit Logs for a ThreadDelete event, this should have an executor (the user who deleted the thread)
5 replies
DIAdiscord.js - Imagine an app
Created by Koi on 3/7/2024 in #djs-questions
How to get the user id, username, nick when mentioned by another user
Where is the message coming from, DM or channel? message.members don't exist in a DM channel message
19 replies
DIAdiscord.js - Imagine an app
Created by probablyraging on 3/4/2024 in #djs-questions
MaxListenersExceededWarning: Possible EventEmitter memory leak..
Well I've been running it with the trace warnings flag for about an hour now with no max listener warning, so I'm going to assume something I've done fixed it 🤷🏽‍♂️
12 replies
DIAdiscord.js - Imagine an app
Created by probablyraging on 3/4/2024 in #djs-questions
MaxListenersExceededWarning: Possible EventEmitter memory leak..
For sure, I'll give it a try and see what I can find. Might also be worth mentioning that the warning will randomly show up. I'd expect it to show up around the time I run the bot, seeing as that is when I'm importing those events, but it's usually within 10-30 minutes after. I have doubled checked to see if I might just randomly be registering a listener somewhere throughout my code, but I can't find anything Appreciate the help, will update if I find anything
12 replies
DIAdiscord.js - Imagine an app
Created by probablyraging on 3/4/2024 in #djs-questions
MaxListenersExceededWarning: Possible EventEmitter memory leak..
If you need anything else, let me know
12 replies
DIAdiscord.js - Imagine an app
Created by probablyraging on 3/4/2024 in #djs-questions
MaxListenersExceededWarning: Possible EventEmitter memory leak..
Also those are the only listeners I'm using, so I'd be confused how any more are being added after the fact
12 replies
DIAdiscord.js - Imagine an app
Created by probablyraging on 3/4/2024 in #djs-questions
MaxListenersExceededWarning: Possible EventEmitter memory leak..
Excuse the ping, force of habit hitting reply
12 replies
DIAdiscord.js - Imagine an app
Created by probablyraging on 3/4/2024 in #djs-questions
MaxListenersExceededWarning: Possible EventEmitter memory leak..
Roger that, I did double check if the event name values were correct, and they were. Here is my event handler
import { promisify } from 'util';
import glob from 'glob';
const PG = promisify(glob);

export default async (client, Discord) => {
(await PG(`${process.cwd()}/events/*/*.js`)).map(async (file) => {
const { default: event } = await import('file://' + file);
console.log(event.name)
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client, Discord));
} else {
client.on(event.name, (...args) => event.execute(...args, Discord));
}
});
};
import { promisify } from 'util';
import glob from 'glob';
const PG = promisify(glob);

export default async (client, Discord) => {
(await PG(`${process.cwd()}/events/*/*.js`)).map(async (file) => {
const { default: event } = await import('file://' + file);
console.log(event.name)
if (event.once) {
client.once(event.name, (...args) => event.execute(...args, client, Discord));
} else {
client.on(event.name, (...args) => event.execute(...args, Discord));
}
});
};
Here is a snippet of how I'm applying those name values
export default {
name: 'ready',
once: true,
async execute(message, client, Discord) {
console.log(client._events)
//...
export default {
name: 'ready',
once: true,
async execute(message, client, Discord) {
console.log(client._events)
//...
As far as I can tell, everything is imported and exported as expected, but I very well might be missing something
12 replies
DIAdiscord.js - Imagine an app
Created by probablyraging on 3/4/2024 in #djs-questions
MaxListenersExceededWarning: Possible EventEmitter memory leak..
So when I log client._events I get the following output. These appear to be all the events that I am listening to, but still getting that same warning
{
shardDisconnect: [Function (anonymous)],
ready: [AsyncFunction (anonymous)],
channelDelete: [Function (anonymous)],
emojiDelete: [Function (anonymous)],
roleDelete: [Function (anonymous)],
stickerDelete: [Function (anonymous)],
threadCreate: [Function (anonymous)],
threadDelete: [Function (anonymous)],
guildMemberRemove: [Function (anonymous)],
guildMemberUpdate: [Function (anonymous)],
messageUpdate: [Function (anonymous)],
inviteCreate: [Function (anonymous)],
inviteDelete: [Function (anonymous)],
messageDelete: [Function (anonymous)],
interactionCreate: [Function (anonymous)],
guildMemberAdd: [Function (anonymous)],
messageCreate: [Function (anonymous)]
}
{
shardDisconnect: [Function (anonymous)],
ready: [AsyncFunction (anonymous)],
channelDelete: [Function (anonymous)],
emojiDelete: [Function (anonymous)],
roleDelete: [Function (anonymous)],
stickerDelete: [Function (anonymous)],
threadCreate: [Function (anonymous)],
threadDelete: [Function (anonymous)],
guildMemberRemove: [Function (anonymous)],
guildMemberUpdate: [Function (anonymous)],
messageUpdate: [Function (anonymous)],
inviteCreate: [Function (anonymous)],
inviteDelete: [Function (anonymous)],
messageDelete: [Function (anonymous)],
interactionCreate: [Function (anonymous)],
guildMemberAdd: [Function (anonymous)],
messageCreate: [Function (anonymous)]
}
12 replies
DIAdiscord.js - Imagine an app
Created by 박준서 on 3/3/2024 in #djs-questions
Can I change the customization status of users on my server in bulk?
A bot can't change a user's status, period
3 replies