Installation
#
Requirements- Node.js version >= 12 or above (which can be checked by running
node -v
). You can use nvm for managing multiple Node versions on a single machine installed
#
Install#
Select environmentDepending on your environment, you need to use different import paths. Currently, two environments are supported:
node
โ if you run the code in the Node.jsbrowser
โ if you run the code in a browser environment
node
environment#
Import for browser
environment#
Import for #
Configure default storageWe have default storages. The storage is used to store the session (authentication keys, server salts and time offset). Depending on the environment, you need to pass different parameters for the storage. But you can also use custom storage
node
environment#
For In the storageOptions.path
, pass the absolute path to the json file through the constructor
browser
environment#
For The window.localStorage
is used for storage. You don't need to pass storageOptions
api_id
and api_hash
#
Getting About abuse
If you use the Telegram API for flooding, spamming, faking subscriber and view counters of channels, you will be banned forever
- Login into https://my.telegram.org/
- Go to https://my.telegram.org/apps and fill out the form
- Take the
api_id
andapi_hash
from the "app configuration" section
#
Final check#
Create simple fileexample.js