pineafan | 3276721 | 2022-03-14 21:27:39 +0000 | [diff] [blame^] | 1 | module.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 | } |