import { GuildMember } from 'discord.js' ; import { Handler } from '../../common/handler' ; import { IContainer } from '../../common/types' ; export class PersistRolesHandler extends Handler { public name : string = 'PersistRole' ; constructor ( public container ) { super ( ) ; } public execute ( member ) { const roles = Array . from ( member . roles . cache . values ( ) ) ; this . container . userService . setPersistedRoles ( member . id , roles ) ; } }