odysseusmax/tg-index

Where to save the environment variables locally?

KavyaKinjalk opened this issue · 12 comments

I am trying to run this bot locally, but I cannot find where to save the .env file. Where do I save it?

did you find out?

did any of you find it?

imner0 commented

Can you explained how to name the file and how you put variables in that file can you share Screenshot both

Can you explain please?

Like this maybe??

.env

API_ID="12345"
API_HASH="xxxx"
SESSION_STRING = "xxxxxx"
INDEX_SETTINGS="{
  "index_all": true,
  "index_private": false,
  "index_group": false,
  "index_channel": true,
  "exclude_chats": [],
  "include_chats": []
}"
imner0 commented

Thank you bro.

Did you try to run with replit?
I tried so many time but didn't work

Thank you bro.

Did you try to run with replit? I tried so many time but didn't work

How did you setup .env file? Screenshot please?

The location of env file is on the left, and right is the format of env file. It is rte same as what you sent.

Which python version do you have sir?

I am trying to run this on Android Termux and Im still getting this error?

~/tg-index $ python3 -m app
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/tg-index/app/config.py", line 22, in <module>
    api_hash = os.environ["API_HASH"]
               ~~~~~~~~~~^^^^^^^^^^^^
  File "<frozen os>", line 679, in __getitem__
KeyError: 'API_HASH'


Please set the API_ID and API_HASH environment variables correctly
You can get your own API keys at https://my.telegram.org/apps
~/tg-index $

you are correctl using the env file. You just have to put the env file in the "app" directory. Replit does not work anymore because it changed how dependency packages are installed, so you cannot install telethon. Some packages redundancy has changed as well, such as for aiohttp-jinja2. So you cannot run it on replit further, but it is possible to run it locally.

Could you maybe share your tg-index as zip?
Also python version and which modules version you use?