import { Api } from 'telegram' ; import { Snake } from '../../client' ; export async function GetFullChat ( snakeClient , chatId ) { try { let type = await snakeClient . telegram . getEntity ( chatId ) ; if ( type . type == 'channel' ) { return snakeClient . client . invoke ( new Api . channels . GetFullChannel ( { channel : chatId , } ) ) ; } else { return snakeClient . client . invoke ( new Api . messages . GetFullChat ( { chatId : type . id , } ) ) ; } } catch ( error ) { return snakeClient . _handleError ( error , `telegram.getFullChat(${ chatId })` ) ; } }