📕Config Vars

≡ Mandatory Vars

To host bot these are must needed, else bot wouldn't start

APP_ID & API_HASH

Generate
  1. Enter your phone number in international format. Example : +91987456321

  2. Enter the web login code sent to you by Telegram in app.

  3. After successful sign in , Click on API development tools

  4. Enter App Title & Short name and create app.

STRING_SESSION

Generate

You can generate String several ways:

➦ Locally

Run this inside catuserbot directory
pip3 install git+https://github.com/jisan09/Telethon && python3 stringsetup.py

➦ Telegram Bot : @CatSessionBot in telegram: https://t.me/CatStringSessionBot

➦ Repl : https://generatestringsession.sandeep1709.repl.run/

TG_BOT_TOKEN

Generate
  1. Go to @BotFather in telegram : https://t.me/BotFather

  2. Start the bot then send /new_bot

  3. Enter name for your bot & username

The bot will send token after that.

While in botfather turn on inline permission also, for the bot you created

  1. /mybot

  2. Click on your bot name

  3. Bot Settings

  4. Inline Mode

  5. Turn on

DB_URI

First install postgres
sudo apt install postgresql postgresql-contrib
Then run this in terminal
sudo su - postgres bash -c "psql -c \"ALTER USER postgres WITH PASSWORD 'your_password';\" && createdb catuserbot -O postgres"
Your DB_URI will be
postgresql://postgres:your_password@localhost:5432/catuserbot

BADCAT

A boolean variable [ True / False ] that determines whether the userbot should load "badcat" plugins, which contain offensive or NSFW content.

EXTERNAL_REPO

A string variable that contains the link to an external repository where additional plugins , modules for the userbot can be found. The default value is https://github.com/TgCatUB/CatPlugins .

EXTERNAL_REPOBRANCH

A string value that represents the name of a branch in an external GitHub repository. This variable is used by a plugin to determine which branch to use when fetching code from the external repository. The default value is main.

UPSTREAM_REPO

A string variable that contains the link to the repository where the userbot's main code is hosted. The default value is https://github.com/TgCatUB/catuserbot .

UPSTREAM_REPO_BRANCH

A string value that represents the name of a branch in a GitHub repository. This variable is used by a plugin to determine which branch to use when updating the bot. The default value is master.

VCMODE

A boolean variable [ True / False ] that determines whether the userbot should enable voice chat mode.

VC_SESSION

A string variable that contains the session string for the userbot's voice chat mode. This used for playing music in VC using different account. Make using this tutorial .

CHROME_BIN

A string value that represents the path to the Google Chrome binary. This variable is used by the Python program to launch a headless Chrome browser. The default value is /app/.apt/usr/bin/google-chrome

CHROME_DRIVER

A string value that represents the path to the ChromeDriver executable. This variable is used by the Python program to control the headless Chrome browser. The default value is /app/.chromedriver/bin/chromedriver

G_DRIVE_CLIENT_ID

A string value that represents the client ID for the Google Drive plugin. This value is used to authenticate and authorize the plugin to access the Google Drive account. You can obtain this value by creating a project on the Google Cloud Console and enabling the Google Drive API. Refer G-drive tutorial for getting the values.

G_DRIVE_CLIENT_SECRET

A string value that represents the client secret for the Google Drive plugin. This value is used in conjunction with the client ID to authenticate and authorize the plugin. You can obtain this value from the same Google Cloud Console project where you obtained the client ID.

G_DRIVE_FOLDER_ID

A string value that represents the ID of the Google Drive folder that the plugin interacts with. This value is used to specify the folder where the plugin will upload or download files to/from. You can obtain this value from the Google Drive web interface by right-clicking on the desired folder and selecting "Get shareable link". The ID is the string of characters between "id=" and "&" in the link.

GENIUS_API_TOKEN

A string value that represents the API key for the Genius API. This API can be used to retrieve lyrics and other information about songs. The API key can be obtained for free from the Genius website.

SPOTIFY_CLIENT_ID

A string value that represents the client ID for the Spotify API. This value is used to authenticate and authorize the plugin to access the Spotify API. You can obtain this value by creating an app on the Spotify Developer Dashboard and copying the client ID from the app settings. Refer Spotify tutorial for getting the values.

SPOTIFY_CLIENT_SECRET

A string value that represents the client secret for the Spotify API. This value is used in conjunction with the client ID to authenticate and authorize the plugin. You can obtain this value from the same app settings where you copied the client ID.

LASTFM_API

A string value that represents the API key for the Last.fm plugin. This value is used to authenticate and authorize the plugin to access the Last.fm API. You can obtain this value by creating an account on the Last.fm website and generating an API key from the settings page. Refer LastFM tutorial for getting the values.

LASTFM_PASSWORD

A string value that represents the password for the Last.fm account that the plugin interacts with. This value is used to authenticate the plugin to the Last.fm API on behalf of the specified user.

LASTFM_SECRET

A string value that represents the API secret for the Last.fm plugin. This value is used in conjunction with the API key to authenticate and authorize the plugin. You can obtain this value from the same settings page where you generated the API key.

LASTFM_USERNAME

A string value that represents the username for the Last.fm account that the plugin interacts with. This value is used to specify the Last.fm user whose scrobbles will be tracked and displayed by the plugin.

IBM_WATSON_CRED_PASSWORD

A string value that represents the password for the IBM Watson speech-to-text plugin. You can obtain this value from the IBM Watson website. Refer IBM tutorial for getting the values. Refer IBM Tutorial for getting the values.

IBM_WATSON_CRED_URL

A string value that represents the URL for the IBM Watson speech-to-text plugin. You can obtain this value from the IBM Watson website.

≡ Basic and Main Configuration Variables

ALIVE_NAME

a string variable that contains the name of the userbot or chatbot to be displayed in the "alive" status message. The value of this variable can be set as an environment variable or manually in the code.

COMMAND_HAND_LER

A string value that represents the regex pattern for the command handler that should be used for the plugins.

SUDO_COMMAND_HAND_LER

A string value that represents the regex pattern for the command handler that should be used for the sudo plugins.

PLUGIN_CHANNEL

An integer value that represents the channel ID of your custom plugins.

PM_LOGGER_GROUP_ID

An integer value that represents the group ID to which the bot should send notifications about your tagged messages or PMs.

PRIVATE_CHANNEL_BOT_API_ID

An integer value that represents the channel ID of a private channel that the bot should use. This value is used by the .frwd command.

PRIVATE_GROUP_BOT_API_ID

An integer value that represents the group ID of a private group that the bot should use.

HEROKU_API_KEY

A string value that represents the API key for the Heroku plugin. You can obtain this value from the Heroku dashboard.

HEROKU_APP_NAME

A string value that represents the name of the app that you gave for the Heroku plugin.

NO_LOAD

A list of string values that represent the names of the plugins that should not be loaded in the userbot.

THUMB_IMAGE

A string value that represents the URL of the required thumb image for the Telegraph plugin.

TZ

a string variable that contains the timezone of the user or server running the userbot. This value can be obtained from a timezone conversion website or set as an environment variable.

〣 ENV

A boolean variable [ True / False ] that determines whether the userbot should lookup for configs in config.py or in app environment. Default it set to False .

≡ Additional Configuration Variables

GITHUB_ACCESS_TOKEN

A string value that represents an access token for the GitHub API. This token is used to authenticate the Python program with the GitHub API so that it can perform actions like fetching data or creating issues.

Refer Github tutorial to get the value.

GIT_REPO_NAME

A string value that represents the name of a GitHub repository. This value is used by the Python program to identify the repository that it will work with. To obtain this value, you need to specify the name of the repository as an environment variable named GIT_REPO_NAME.

ANTISPAMBOT_BAN

A boolean value that indicates whether SpamWatch, CAS, and SpamProtection ban is needed or not.

FBAN_GROUP_ID

An integer value that represents the ID of the group that the bot should use for working with fban/unfban/superfban/superunfban commands.

SPAMWATCH_API

A string value that represents the API key for the SpamWatch API. This value is used to authenticate and authorize the plugin to access the SpamWatch API. You can obtain this value by creating an account on the SpamWatch website and generating an API key from the dashboard.

COUNTRY

A string value that represents the name of a country. This variable is used by the Python program to set the timezone of the system clock. The default value is an empty string, but you can set it to the name of a country by specifying an environment variable named COUNTRY.

TG_2STEP_VERIFICATION_CODE

A string value that represents the two-step verification code required for accessing the Telegram API. This value is used by the transfer channel plugin to authenticate the user's Telegram account. You can obtain this code by enabling two-step verification on your Telegram account and entering the code when prompted.

TZ_NUMBER

An integer value that represents the number of hours offset from UTC. This variable is used by the Python program to set the timezone of the system clock. The default value is 1, but you can set it to a different value by specifying an environment variable named TZ_NUMBER.

WATCH_COUNTRY

A string value that represents the country for the JustWatch plugin. This value is used to specify the country where the plugin will search for TV shows and movies. The default value is "IN" for India, but you can change it to any other country code supported by JustWatch.

≡ Other Api Variables

DEEP_AI

A string value that represents an API key for the DeepAI service. This key is used to authenticate the Python program with the DeepAI service so that it can perform actions like detecting NSFW text or images. To obtain this value, you need to sign up for a DeepAI account and store your API key as an environment variable named DEEP_AI.

CURRENCY_API

A string value that represents the API key for the Currency Converter API. This API can be used to convert currencies. The API key can be obtained for free from the Currency Converter website.

IPDATA_API

A string value that represents the API key for the ipdata.co API. This API can be used to retrieve geolocation information for an IP address. The API key can be obtained for free from the ipdata.co website.

OCR_SPACE_API_KEY

A string value that represents the API key for the OCR.Space API. This API can be used to perform Optical Character Recognition (OCR) on images. The API key can be obtained for free from the OCR.Space website. Get your api key from here

OPENAI_API_KEY

A string value that represents the API key for the OpenAI API. This value is used to authenticate and authorize the plugin to access the OpenAI API. You can obtain this value by creating an account on the OpenAI website and generating an API key from the dashboard.

OPEN_WEATHER_MAP_APPID

A string value that represents the APPID for the OpenWeatherMap API. This API can be used to retrieve weather information for a location. The APPID can be obtained for free from the OpenWeatherMap website. Get your api from openweathermap

REM_BG_API_KEY

A string value that represents the API key for the Remove.bg API. This API can be used to remove the background from an image. The API key can be obtained for free from the Remove.bg website.

SCREEN_SHOT_LAYER_ACCESS_KEY

A string value that represents the access key for the screenshot layer API. You can obtain this value from the screenshot layer website.

Last updated