ItzYaBoiRampage
ItzYaBoiRampage
DIAdiscord.js - Imagine an app
Created by ItzYaBoiRampage on 12/12/2024 in #djs-questions
Discord Mod Logging (MemberBanRemove)
cant seem to get this to work
client.on("guildBanRemove", async (guild, user) => {
const entry = await guild.fetchAuditLogs().then(audit => audit.entries.first());

let embed = new EmbedBuilder()
.setThumbnail(entry.executor.avatarURL({ dynamic: true }))
.setDescription(
`**${user.username}**(\`${user.id}\`) has been unbanned.\n\n Unbanned by : **<@${entry.executor.id}>**(\`${entry.executor.id}\`)`
)
.setColor("#E70000")
.setTimestamp();

client.channels.cache.get(MOD_CHANNEL).send({ embeds: [embed] });
});
client.on("guildBanRemove", async (guild, user) => {
const entry = await guild.fetchAuditLogs().then(audit => audit.entries.first());

let embed = new EmbedBuilder()
.setThumbnail(entry.executor.avatarURL({ dynamic: true }))
.setDescription(
`**${user.username}**(\`${user.id}\`) has been unbanned.\n\n Unbanned by : **<@${entry.executor.id}>**(\`${entry.executor.id}\`)`
)
.setColor("#E70000")
.setTimestamp();

client.channels.cache.get(MOD_CHANNEL).send({ embeds: [embed] });
});
ive also tried adding type/actiontype 23 to the fetchAuditLogs, tried adding catch for errors and to log them in the console, havent gotten anywhere tho unfortunatly
7 replies