Forums

How to run always on telegram bot

Hi,

I`m trying to run as an always-on-task my telegram bot, which was working perfectly from files. It contains 3 files, 1 json file, 1 json file which contains the API connection to google sheets and the script.

It runs into error always. Could anyone advice me how to run this bot?

Nov 27 14:11:43 Traceback (most recent call last): Nov 27 14:11:43 File "/home/stepangladonik/MrPollSender/MrPollSenderUPD(22-11).py", line 12, in <module> Nov 27 14:11:43 credentials = ServiceAccountCredentials.from_json_keyfile_name('tgpollbot-72526429da53.json', scope) Nov 27 14:11:43 File "/usr/local/lib/python3.10/site-packages/oauth2client/service_account.py", line 219, in from_json_keyfile_name Nov 27 14:11:43 with open(filename, 'r') as file_obj: Nov 27 14:11:43 FileNotFoundError: [Errno 2] No such file or directory: 'tgpollbot-72526429da53.json'

Fixed.

The error was in the code. The path to the files was incorrect.

OK, glad to hear you sorted it out!