
Passing null for a required string/array is the same as empty (0-length). Optional API parameters have a default value of null when unset. The other configuration items that you can provide include: session_pathname, email, email_verification_code, session_key, server_address, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, firebase, user_id, bot_token
#TELEGRAM MESSENGER CODE CODE#
The Client class also offers an OnUpdate event that is triggered when Telegram servers sends Updates (like new messages or status), independently of your API requests.Īn invalid API request can result in a RpcException being raised, reflecting the error code and status text of the problem. You can have several active sessions for the same phone number.
Session or Authorization: Pairing between a device and a phone number. DC (DataCenter): There are a few datacenters depending on where in the world the user (or an uploaded media file) is from. Access Hash: Telegram requires you to provide a specific access_hash for users, channels, and other resources before interacting with them. It represents each line from your Telegram chat list. Dialog: Status of chat with a Peer (draft, last message, unread count, pinned.). Peer: Either a Chat, a Channel or a User. chats: In plural or general meaning, it means either Chat or Channel (therefore, no private user discussions). ⚠️ Most chat groups you see are really of type Channel, not Chat! (it may be migrated to a supergroup Channel with a new ID when it gets bigger or public, in which case the old Chat will still exist but will be deactivated) Chat: A private basic chat group with less than 200 members. Or a broadcast channel (the broadcast flag differentiate those) Channel: A (large or public) chat group (sometimes called supergroup),. In the API, Telegram uses some terms/classnames that can be confusing as they differ from the terms shown to end-users: ➡️ Check the FAQ if example codes don't compile correctly on your machine, or other troubleshooting. ➡️ You can find lots of useful code snippets in EXAMPLESĪnd more detailed programs in the Examples subdirectory.
SendMessageAsync (target, "Hello, World " ) Static async Task Main ( string _ ) " ) await client.