hytescript.js
Version:
A package for programming anything you want with ease.
23 lines (18 loc) • 836 B
JavaScript
const { clone, replaceLast } = require("../utils/utils")
module.exports = async d => {
let requiredIntents = ['GuildBans']
if (requiredIntents.find(intent => !d.clientOptions.intents.includes(intent))) new d.error('requiredIntent', replaceLast(__filename.replace("/", "\\").split('\\').at('-1'), '.js', ''), ...requiredIntents)
d.client.on('guildBanRemove', async ban => {
d.commandManager.userUnban.forEach(async commandData => {
let data = clone(d)
data.ban = ban
data.guild = ban.guild
data.author = ban.user
data.command = commandData
data.eventType = 'userUnban'
data.err = false
data.data = d.data.newInstance()
await data.command.code.parse(data)
})
})
}