2021-12-10 21:39:54 +05:00
const Discord = require ( "discord.js" ) ;
module . exports = class {
2021-12-26 19:29:37 +05:00
constructor ( client ) {
2021-12-10 21:39:54 +05:00
this . client = client ;
}
2021-12-26 19:29:37 +05:00
async run ( guild ) {
2021-12-10 21:39:54 +05:00
const text = ` Вышел с сервера ** ${ guild . name } **. Н а нём ** ${ guild . members . cache . filter ( ( m ) => ! m . user . bot ) . size } ** пользователей (из них ${ guild . members . cache . filter ( ( m ) => m . user . bot ) . size } ботов) ` ;
// Sends log embed in the logs channel
const embed = new Discord . MessageEmbed ( )
2022-01-03 23:20:33 +05:00
. setAuthor ( { name : guild . name , iconURL : guild . iconURL ( ) } )
2021-12-10 21:39:54 +05:00
. setColor ( "#B22222" )
. setDescription ( text ) ;
this . client . channels . cache . get ( this . client . config . support . logs ) . send ( embed ) ;
}
} ;