Config vars
Detailed description of config variables
Config file
All the config variables are stored in a single file named .env
at the root of Mega.nz-Bot directory.
For reference please look at the below example,
Mandatory
As the name suggests these variables must be present in either as an environment variable or in .env
file in order for the bot to function properly.
APP_ID
- Your APP_ID. Get it from my.telegram.orgAPI_HASH
- Your API_ID. Get it from my.telegram.orgBOT_TOKEN
- Your Bot Token From @BotFather
Optional
Bot can function without these variables. However you won't be able to use all of it's features such as upload, private content downloader.
MEGA_EMAIL
- Your Mega account email address. Use this to associate the bot with a specific Mega account for private deployments.MEGA_PASSWORD
- The password for your Mega account specified in MEGA_EMAIL.USE_ENV
- Set this to 'true' if you're running a private bot with a single Mega account usingMEGA_EMAIL
andMEGA_PASSWORD
. Defaults toFalse
LOG_CHAT
- A chat ID where you want to receive user activity logs. Ensure the bot has admin privileges in this chat.MONGO_URI
- A mongodb urlIt is recommended to setup this as you can manage multiple accounts when using a database
AUTH_USERS
- A list of authorized user IDs, separated by a space*
: All the users can use the bot without restrictions*|<user_id> <user_id>...
: Bot is available for public use and user ids act as admins<user_id> <user_id>...
: Bot is only available for these users
CYPHER_KEY
- A private key used to encrypt data before sending it to the database. Highly recommended to generate a new keyCHUNK_SIZE
- Number of bytes bot should read into memory when downloading from DDLIncreasing chunk size speeds up the download process while also increasing memory usage.
Keep it between
1024
-1048576
(1 KiB - 1 MiB) for optimal performanceDefaults to
524288
(500 KiB)
TG_MAX_SIZE
- Maximum file size that can be uploaded in a single piece. If a file exceeds this value, it will be automatically split into smaller chunks of the specified size.You can lower this value if you need to create smaller file chunks for specific purposes. For example, setting it to 500 MiB (megabytes) would split any file larger than 500 MiB into 500 MiB chunks.
Defaults to telegram limit of
2040108421
bytes (2 GiB)
DOWNLOAD_LOCATION
- Path to the folder where files need to be downloaded. Defaults to the "{current working directory}/NexaBots
"
Last updated