(peer: any)
| 254 | if (peer.channelId !== undefined && peer.channelId !== null) { |
| 255 | return peer.channelId.toString(); |
| 256 | } |
| 257 | if (peer.chatId !== undefined && peer.chatId !== null) { |
| 258 | return peer.chatId.toString(); |
| 259 | } |
| 260 | if ( |
| 261 | typeof peer === "bigint" || |
| 262 | typeof peer === "number" || |
| 263 | typeof peer === "string" |
| 264 | ) { |
| 265 | return peer.toString(); |
| 266 | } |
| 267 | return null; |
| 268 | } |
| 269 | |
| 270 | async function getSendAsIdentitySet( |
| 271 | client: TelegramClient, |
| 272 | chatEntity: any |
| 273 | ): Promise<{ typedKeys: Set<string>; rawIds: Set<string> }> { |
| 274 | const typedKeys = new Set<string>(); |
| 275 | const rawIds = new Set<string>(); |
| 276 | try { |
| 277 | const sendAs = await client.invoke( |
| 278 | new Api.channels.GetSendAs({ |
no outgoing calls
no test coverage detected