Fallen
Fallen
Explore posts from servers
DIdiscord.js - Imagine ❄
Created by Fallen on 7/17/2023 in #djs-questions
How to fetch a guild from the cache on another shard
DJS: v14.11.0 Node: v18.13.0
3 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
Whenever this function executes getting the guild from the cache is still returning undefined
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
nevermind already found an error in that
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
I just rewrote that function to be cache based
schedule('*/5 * * * *', async () => {
const guilds = await Guild.find({ 'memberCount.enabled': true });
for (const g of guilds) {
if (!g.memberCount.channel) return;
const guild = client.guilds.cache.get(g.guild);
if (!guild) return;
const channel = client.channels.cache.get(g.memberCount.channel);
if (!channel || channel.type !== ChannelType.GuildVoice) return;
await channel.edit({ name: g.memberCount.name ? g.memberCount.name.replace('{members}', guild.memberCount.toString()) : `Members: ${guild.memberCount}`, reason: 'Automated Action: Member Count Updated' });
}
});
schedule('*/5 * * * *', async () => {
const guilds = await Guild.find({ 'memberCount.enabled': true });
for (const g of guilds) {
if (!g.memberCount.channel) return;
const guild = client.guilds.cache.get(g.guild);
if (!guild) return;
const channel = client.channels.cache.get(g.memberCount.channel);
if (!channel || channel.type !== ChannelType.GuildVoice) return;
await channel.edit({ name: g.memberCount.name ? g.memberCount.name.replace('{members}', guild.memberCount.toString()) : `Members: ${guild.memberCount}`, reason: 'Automated Action: Member Count Updated' });
}
});
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
I need to filter the members to remove bots
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
Instead of fetching everything
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
Would it be better to pull from the cache?
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
but it's not done
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
Because im planning on advertising it
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
My bot is in about 12 guilds right now, it is sharded if that causes an issue
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 6/14/2023 in #djs-questions
Error fetching guild on client ready event
Discord.js: v14.11.0 Node.js: v18.13.0
20 replies
DIdiscord.js - Imagine ❄
Created by Fallen on 5/25/2023 in #djs-voice
Audio Player state changes to playing when resource ends
Discord.js: 14.8.0 @discordjs/voice: 0.16.0
5 replies