try {
// Send DM to the user with the LeetCode question
await member.user.send(
`You have been timed out in ${member.guild.name}. To get your timeout removed, solve this LeetCode question and reply with submission link or screenshot: ${randomLeetCodeQuestion}`,
);
console.log(`Successfully sent LeetCode question to ${member.user.tag}`);
const redirectChannel = member.guild.channels.cache.get(
config.LEETCODE_LOGS_CHANNEL_ID,
);
await redirectChannel.send(
`Successfully sent LeetCode question to ${member.user.tag}`,
);
} catch (error) {
console.error(`Failed to send DM to ${member.user.tag}:`, error);
}
try {
// Send DM to the user with the LeetCode question
await member.user.send(
`You have been timed out in ${member.guild.name}. To get your timeout removed, solve this LeetCode question and reply with submission link or screenshot: ${randomLeetCodeQuestion}`,
);
console.log(`Successfully sent LeetCode question to ${member.user.tag}`);
const redirectChannel = member.guild.channels.cache.get(
config.LEETCODE_LOGS_CHANNEL_ID,
);
await redirectChannel.send(
`Successfully sent LeetCode question to ${member.user.tag}`,
);
} catch (error) {
console.error(`Failed to send DM to ${member.user.tag}:`, error);
}