import { GuildMember } from 'discord.js';
import { EventHandler } from '../utils/types';
import { context } from '../config/context';

const event: EventHandler = {
  name: 'guildMemberRemove',
  execute(member: GuildMember) {
    context.logging.logMemberLeave(member);
    context.stats.refreshGuild(member.guild.id).catch(() => undefined);
  }
};

export default event;
