blob: 614f0f5824ecef88d111e562d2d14e9be0fe4967 [file] [log] [blame]
pineafan32767212022-03-14 21:27:39 +00001module.exports = {
2 name:'guilidBanRemove',
3 once:false,
4 async execute(ban) {
5 let logs = await ban.guild.fetchAuditLogs({'type': 'MEMBER_BAN_REMOVE'});
6 let log = logs.entries.find(log => log.target.id === ban.user.id);
7
8 let data = {
9 id: ban.user.id,
10 username: ban.user.username,
11 reason: ban.reason,
12 unbannedAt: log.createdTimestamp,
13 unbannedBy: log.executor.id
14 }
15
16 addLog(ban.guild.id, data);
17 }
18}