pineafan | 3276721 | 2022-03-14 21:27:39 +0000 | [diff] [blame] | 1 | const {addLog} = require('../scripts/addLogs'); |
| 2 | |
| 3 | module.exports = { |
| 4 | name:'inviteCreate', |
| 5 | once:false, |
| 6 | async execute(invite) { |
| 7 | |
| 8 | const i = await invite.guild.invites.fetch(invite.code) |
| 9 | |
| 10 | let data = { |
| 11 | channel: invite.channel.id, |
| 12 | code: invite.code, |
| 13 | createdAt: invite.createdTimestamp, |
| 14 | expiresAt: invite.expiresTimestamp, |
| 15 | createdBy: invite.inviter.id, |
| 16 | maxUsage: i.maxUses, |
| 17 | maxAge: i.maxAge |
| 18 | } |
| 19 | |
| 20 | addLog(invite.guild.id, data) |
| 21 | } |
| 22 | } |