// get the channel entity by its username
const channel = await client.getEntity("username"); // pass the username of the channel
console.log(channel.id); // this will print the channel ID
console.log(channel.accessHash); // this will print the channel access hash
// or get the channel entity by its ID
const channel = await client.getEntity(new Api.PeerChannel({ channelId: 1622214202 })); // pass a PeerChannel object with the channel ID
console.log(channel.id); // this will print the channel ID
console.log(channel.accessHash); // this will print the channel access hash