Skip to content

Commit

Permalink
Force fetch all guild roles on start
Browse files Browse the repository at this point in the history
  • Loading branch information
encode42 committed Jun 29, 2024
1 parent fcacf83 commit f277e59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ log.info(`Logged in under username "${username}".`);
log.debug("Fetching primary guild...");
await client.guilds.fetch();
export const guild = await client.guilds.fetch(string("GUILD_ID"));
const guildRoles = await guild.roles.fetch();

log.debug("Finding managed role...");
let foundManagedRole: Role | undefined;
for (const [_, role] of guild.roles.cache) {
for (const [_, role] of guildRoles) {
if (role.name !== username) {
continue;
}
Expand Down

0 comments on commit f277e59

Please sign in to comment.