buddy

node MVC discord bot
Log | Files | Refs | README

GuildBanRemove.js (638B)


      1 'use strict';
      2 
      3 const Action = require('./Action');
      4 const { Events } = require('../../util/Constants');
      5 
      6 class GuildBanRemove extends Action {
      7   handle(data) {
      8     const client = this.client;
      9     const guild = client.guilds.cache.get(data.guild_id);
     10     const user = client.users.add(data.user);
     11     /**
     12      * Emitted whenever a member is unbanned from a guild.
     13      * @event Client#guildBanRemove
     14      * @param {Guild} guild The guild that the unban occurred in
     15      * @param {User} user The user that was unbanned
     16      */
     17     if (guild && user) client.emit(Events.GUILD_BAN_REMOVE, guild, user);
     18   }
     19 }
     20 
     21 module.exports = GuildBanRemove;