Skip to content

Commit 55253ec

Browse files
author
xyzjesper
committed
Change cache to fecht for channel and roles in Verification Module
1 parent 2f78fb6 commit 55253ec

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/systems/verifictionAction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ export async function verifyAction(
2626
throw new Error("Verification gate is not active.");
2727
}
2828

29-
const guildMember = member.guild.members.cache.get(member.id);
29+
const guildMember = await member.guild.members.fetch(member.id);
3030

3131

3232
if (action == VerificationAction.AddRole) {
3333
for (const roleId of data.Roles) {
34-
const role = member.guild.roles.cache.get(roleId);
34+
const role = await member.guild.roles.fetch(roleId);
3535
if (role) {
3636
if (!guildMember?.roles.cache.has(roleId)) {
3737
await guildMember?.roles.add(role);
@@ -44,7 +44,7 @@ export async function verifyAction(
4444
if (action == VerificationAction.AddPermissionToChannel) {
4545

4646
for (const permission of data.ChannelPermissions) {
47-
const channel = guildMember?.guild.channels.cache.get(permission.ChannelId);
47+
const channel = await guildMember?.guild.channels.fetch(permission.ChannelId);
4848
if (channel) {
4949
if (!channel.isTextBased()) continue;
5050

0 commit comments

Comments
 (0)