ItzYaBoiRampage
ItzYaBoiRampage
DIAdiscord.js - Imagine an app
Created by ItzYaBoiRampage on 12/12/2024 in #djs-questions
Discord Mod Logging (MemberBanRemove)
if you could could you create an example of this, i cant find the bit i used but im pretty sure i remember trying that last night
7 replies
DIAdiscord.js - Imagine an app
Created by ItzYaBoiRampage on 12/12/2024 in #djs-questions
Discord Mod Logging (MemberBanRemove)
sorry for the late response i had work this morning, heres what i got to work for now
client.on(Events.GuildBanRemove, async (ban) => {
const { guild, user } = ban;

const entry = await guild.fetchAuditLogs({
limit: 1,
type: AuditLogEvent.MemberBanRemove,
}).then(audit => audit.entries.first());

if (!entry || !entry.executor) return;

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

const modChannel = client.channels.cache.get(MOD_CHANNEL);
if (modChannel) {
modChannel.send({ embeds: [embed] });
}
});
client.on(Events.GuildBanRemove, async (ban) => {
const { guild, user } = ban;

const entry = await guild.fetchAuditLogs({
limit: 1,
type: AuditLogEvent.MemberBanRemove,
}).then(audit => audit.entries.first());

if (!entry || !entry.executor) return;

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

const modChannel = client.channels.cache.get(MOD_CHANNEL);
if (modChannel) {
modChannel.send({ embeds: [embed] });
}
});
going to try some other ways tho but atleast it works
7 replies
DIAdiscord.js - Imagine an app
Created by ItzYaBoiRampage on 12/12/2024 in #djs-questions
Discord Mod Logging (MemberBanRemove)
iirc I tried that as well and wasn’t able to get anything either
7 replies