You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returninteraction.editReply({content: '❌ Could not fetch the main guild to find unverified users. Please check the GUILD_ID environment variable.'});
60
+
}
61
+
62
+
letmembers;
63
+
try{
64
+
// Fetch all members to check their roles
65
+
members=awaittargetGuild.members.fetch();
66
+
}catch(error){
67
+
console.error(`Error fetching members for guild ${GUILD_ID}:`,error);
68
+
returninteraction.editReply({content: '❌ Could not fetch members from the main guild. Please ensure the bot has the "Guild Members Intent" enabled and sufficient permissions.'});
69
+
}
70
+
71
+
letunverifiedMembers=members.filter(member=>
72
+
!member.user.bot&&// Exclude bots
73
+
!member.roles.cache.has(VERIFIED_ROLE_ID)// Include members without the verified role
74
+
);
75
+
76
+
// --- START: Temporary filter for testing specific user ---
77
+
if(targetUser){
78
+
// For testing purposes, filter to only include the target user
79
+
// REMOVE this block for production use to send to all unverified members
console.log(`[RemindVerify] Testing mode: Targeting only user ${targetUser.tag} (${targetUser.id}).`);
84
+
}else{
85
+
returninteraction.editReply({content: `⚠️ User ${targetUser.tag} is either a bot, already verified, or not found in the main guild. Cannot send reminder.`});
86
+
}
87
+
}
88
+
// --- END: Temporary filter for testing specific user ---
89
+
90
+
91
+
if(unverifiedMembers.size===0){
92
+
returninteraction.editReply({content: '✅ No unverified members found in the server at this time.'});
93
+
}
94
+
95
+
letsentCount=0;
96
+
letfailedCount=0;
97
+
constfailedUsers=[];
98
+
99
+
constreminderEmbed=newEmbedBuilder()
100
+
.setColor('#FFA500')// Orange color for reminder
101
+
.setTitle('🔔 Verification Reminder!')
102
+
.setDescription('It looks like you haven\'t completed your verification yet. To gain full access to the server\'s channels, please complete the verification process.')
103
+
.addFields(
104
+
{name: 'How to Verify:',value: 'Please use the `/verify` command in any channel (or in my DMs) and follow the instructions. If you already started, you can use `/confirmotp` with your code.'},
105
+
{name: 'Need Help?',value: 'If you encounter any issues, please reach out to an administrator in the server.'}
0 commit comments