Enze
Enze
Explore posts from servers
DIAdiscord.js - Imagine a boo! 👻
Created by Enze on 2/9/2024 in #djs-questions
Fetching specific guilds across all shards
Hey there, what's the proper way of finding specific guilds across all shards? I tried following the tutorial on the guide but I don't quite get it. This is how I'm doing it, but I always get ReferenceError: notification is not defined - Are we not allowed to access outside-variables within broadcastEval? Am I even doing this right? Do I even need broadcastEval? Appreciate every hint.
// Loop through all guilds
const notifications = await EpisodeChannelModel.find({});
for (const notification of notifications) {
await client.shard?.broadcastEval(async (client) => {
const guild = await client.guilds.fetch(notification.guildId);
console.log(guild.name);
});
}
// Loop through all guilds
const notifications = await EpisodeChannelModel.find({});
for (const notification of notifications) {
await client.shard?.broadcastEval(async (client) => {
const guild = await client.guilds.fetch(notification.guildId);
console.log(guild.name);
});
}
27 replies
CDCloudflare Developers
Created by Enze on 11/4/2023 in #pages-help
Custom domain with different paths for each repository
Hey there, I have a question regarding the hosting capabilities on Cloudflare Pages. Suppose I have two separate repositories, X and Y, and my intention is to host both under the same domain, such as your.domain.com. The structure I'm aiming for is to have repository X accessible at your.domain.com/previews/X and repository Y at your.domain.com/previews/Y. Does Cloudflare Pages support this type of configuration? Thanks in advance.
5 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Enze on 8/11/2023 in #djs-questions
Fetch more than 100 messages in a channel
Hey, I know that I shouldn't fetch more than 100 messages but it's a bot in one server so I wanted to know if there is a way to fetch all messages. Is it possible to slowly cache all messages at bot startup? There will be less than 1'000 messages for now. Currently about 500.
36 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Enze on 10/8/2022 in #djs-questions
Fetching users with ShardManager
hey, how would this example work for fetches? Like users.fetch() : https://discordjs.guide/sharding/#fetchclientvalues
49 replies