2022-03-19 17:37:45 +07:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
const Action = require('./Action');
|
2022-03-24 17:55:32 +07:00
|
|
|
const { Events } = require('../../util/Constants');
|
2022-03-19 17:37:45 +07:00
|
|
|
|
|
|
|
|
class GuildBanAdd extends Action {
|
|
|
|
|
handle(data) {
|
|
|
|
|
const client = this.client;
|
|
|
|
|
const guild = client.guilds.cache.get(data.guild_id);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Emitted whenever a member is banned from a guild.
|
|
|
|
|
* @event Client#guildBanAdd
|
|
|
|
|
* @param {GuildBan} ban The ban that occurred
|
|
|
|
|
*/
|
2022-03-24 17:55:32 +07:00
|
|
|
if (guild) client.emit(Events.GUILD_BAN_ADD, guild.bans._add(data));
|
2022-03-19 17:37:45 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = GuildBanAdd;
|