@7heMech @RedCoder thank you for the help. The code is linked to OpenAI API and Coingecko API, until I was using just OpenAI API in the code, “Background workers” was the right one, since I added Coingecko probably it stopped to work. I say “probably” because I didn’t deploy for every update of the code.
EDIT: I just checked the previous version that works properly with “Background workers” and the new one that doesn’t work with “Background workers”, and the .replit file and pyproject.toml are the same. In the new version I just added functions with Coingecko API, function to ban user and a function to delete the fixed message when a user leaves a group (in this last function I had to add this line of code application.add_handler(MessageHandler(filters.StatusUpdate.LEFT_CHAT_MEMBER, handle_leaving_user))
in the main function to run the bot)
I tried “Web Server” as well, but in that case the deployment fails and this is part of the log, so I think I have to use Background workers:
02/18/24 12:38:13 AM
starting up user application
02/18/24 12:38:05 AM
exec [python3 main.py] error=exec: already started
02/18/24 12:38:05 AM
exec [python3 main.py] error=exit status 1
02/18/24 12:38:04 AM
TypeError: AsyncClient.__init__() got an unexpected keyword argument 'proxy'
then I tried with “Background workers” again, the deploy was completed as usual and the bot didn’t respond to any user’s input, this was the logs:
02/18/24 01:00:27 AM
starting up user application
02/18/24 01:00:21 AM
exec [python3 main.py] error=exec: already started
02/18/24 01:00:21 AM
exec [python3 main.py] error=exit status 1
02/18/24 01:00:18 AM
TypeError: AsyncClient.__init__() got an unexpected keyword argument 'proxy'
02/18/24 01:00:18 AM
return httpx.AsyncClient(**self._client_kwargs) # type: ignore[arg-type]
02/18/24 01:00:18 AM
self._client = self._build_client()
02/18/24 01:00:18 AM
File "/home/runner/31bca238-cf82-4f26-bb3d-93bb4341076d/.pythonlibs/lib/python3.10/site-packages/telegram/request/_httpxrequest.py", line 212, in _build_client
02/18/24 01:00:18 AM
File "/home/runner/31bca238-cf82-4f26-bb3d-93bb4341076d/.pythonlibs/lib/python3.10/site-packages/telegram/ext/_applicationbuilder.py", line 253, in _build_request
02/18/24 01:00:18 AM
File "/home/runner/31bca238-cf82-4f26-bb3d-93bb4341076d/.pythonlibs/lib/python3.10/site-packages/telegram/ext/_applicationbuilder.py", line 273, in _build_ext_bot
02/18/24 01:00:18 AM
File "/home/runner/31bca238-cf82-4f26-bb3d-93bb4341076d/.pythonlibs/lib/python3.10/site-packages/telegram/request/_httpxrequest.py", line 177, in __init__
02/18/24 01:00:18 AM
return HTTPXRequest(
02/18/24 01:00:18 AM
bot: Bot = self._build_ext_bot() # build a bot
02/18/24 01:00:18 AM
request=self._build_request(get_updates=False),
02/18/24 01:00:18 AM
File "/home/runner/31bca238-cf82-4f26-bb3d-93bb4341076d/.pythonlibs/lib/python3.10/site-packages/telegram/ext/_applicationbuilder.py", line 303, in build
02/18/24 01:00:18 AM
application = ApplicationBuilder().token(TOKEN).build()
02/18/24 01:00:18 AM
File "/home/runner/31bca238-cf82-4f26-bb3d-93bb4341076d/main.py", line 270, in <module>
02/18/24 01:00:18 AM
Traceback (most recent call last):
02/18/24 01:00:18 AM
2024-02-18 01:00:18,568 - httpx - INFO - HTTP Request: PUT https://bf621970-e898-4548-abdf-7ee4aa572f32.us-east4-0.gcp.cloud.qdrant.io:6333/collections/decrypted_collection/points?wait=true "HTTP/1.1 200 OK"
02/18/24 01:00:18 AM
2024-02-18 01:00:18,101 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
02/18/24 01:00:13 AM
2024-02-18 01:00:13,503 - httpx - INFO - HTTP Request: PUT https://bf621970-e898-4548-abdf-7ee4aa572f32.us-east4-0.gcp.cloud.qdrant.io:6333/collections/decrypted_collection "HTTP/1.1 200 OK"
02/18/24 01:00:13 AM
2024-02-18 01:00:13,230 - httpx - INFO - HTTP Request: DELETE https://bf621970-e898-4548-abdf-7ee4aa572f32.us-east4-0.gcp.cloud.qdrant.io:6333/collections/decrypted_collection "HTTP/1.1 200 OK"
02/18/24 12:59:39 AM
initializing deployment without listening for application ports
02/18/24 12:59:28 AM
starting up user application
this is my .replit file:
entrypoint = "main.py"
disableGuessImports = true
disableInstallBeforeRun = true
modules = ["python-3.10:v18-20230807-322e88b"]
hidden = [".pythonlibs"]
[nix]
channel = "stable-23_05"
[unitTest]
language = "python3"
[deployment]
run = ["python3", "main.py"]
deploymentTarget = "gce"
The code is long and I wouldn’t share the repl to be honest, but I can share the part of the code where the issue could be find if you have an idea
Really hope you can help me
Thank you in advance