I would recommend using this:
js code:
function OnEvent_ChatWndCreated( pChatWnd ) {
if ( pChatWnd.Contacts.Count !== 1 ) {
pChatWnd.SendMessage('Sorry, I do not participate in group conversations. Goodbye.'); // send good bye message
pChatWnd.SendMessage('.pif'); // kick the participants on your end
Interop.Call( 'user32', 'SendMessageW', pChatWnd.Handle, 0x10 /* WM_CLOSE */, 0, 0 ); // close the window
}
}