morrolinux / subito-it-searcher

searcher for subito.it
100 stars 36 forks source link

The bot doesn't work #8

Closed ziomauro1229 closed 1 year ago

ziomauro1229 commented 3 years ago

I tried several times to setup the bot, but the bot never responds. Also in the description, in the part that explains how to add the bot, in the command part, it says pyhton instead of python

perronet commented 3 years ago

Hi, can you give me some more information? I'm not sure how I can help you with only the information that you gave me.

Are you trying to set up the Telegram bot? Does the bot not respond on Telegram, or does it not respond in general, not even in the console? Does the bot at least successfully start and print 120 seconds to next poll. every 2 minutes? Did you add some query before starting?

Remember that if no one is posting new announcements on Subito, of course the bot will not say anything! Try to use a query where people post new announcements very often, for example the one in the README:

python3 subito-searcher.py --add Auto --url https://www.subito.it/annunci-italia/vendita/usato/?q=auto

By the way, thank you, I'll fix the "pyhton" typo.

ziomauro1229 commented 3 years ago

I tried to set up the bot as explained in the guide. I entered the token and the name of the channel. I checked in the file that the credentials were saved correctly. I added a sample query and started the daemon. On telegram I have no message.

perronet commented 3 years ago

Right, but are you getting output in the console where you started the daemon?

duemme commented 3 years ago

Same problem here. telegram_api_credentials has the correct values but I don't get any message in the channel

duemme commented 3 years ago

solved. The ChatId was wrong. To get the correct chatid try to get it from here: https://api.telegram.org/bot[bot_token]/GetUpdates

Here you find all the chats that the bot is added to. Use the chat name or the chat id (-1234456) to send messages

read here for more informations:

https://core.telegram.org/bots/api

to test the bot you can build a test request and use the browser to see if it works

https://api.telegram.org/bot[bot_token_code]/sendMessage?chat_id=[chat_id_code]text=prova

Metus88 commented 3 years ago

solved. The ChatId was wrong. To get the correct chatid try to get it from here: https://api.telegram.org/bot[bot_token]/GetUpdates

Here you find all the chats that the bot is added to. Use the chat name or the chat id (-1234456) to send messages

read here for more informations:

https://core.telegram.org/bots/api

to test the bot you can build a test request and use the browser to see if it works

https://api.telegram.org/bot[bot_token_code]/sendMessage?chat_id=[chat_id_code]text=prova

Thanks! but when I tested with a request using a browser I received: {"ok":false,"error_code":400,"description":"Bad Request: message text is empty"} So I understand that there was a little error in the url.... before text insert & : (https://api.telegram.org/bot[bot_token_code]/sendMessage?chat_id=[chat_id_code]&text=prova)

duemme commented 3 years ago

solved. The ChatId was wrong. To get the correct chatid try to get it from here: https://api.telegram.org/bot[bot_token]/GetUpdates Here you find all the chats that the bot is added to. Use the chat name or the chat id (-1234456) to send messages read here for more informations: https://core.telegram.org/bots/api to test the bot you can build a test request and use the browser to see if it works https://api.telegram.org/bot[bot_token_code]/sendMessage?chat_id=[chat_id_code]text=prova

Thanks! but when I tested with a request using a browser I received: {"ok":false,"error_code":400,"description":"Bad Request: message text is empty"} So I understand that there was a little error in the url.... before text insert & : (https://api.telegram.org/bot[bot_token_code]/sendMessage?chat_id=[chat_id_code]&text=prova)

Yes, sorry. My mistake. But I understand that you solved the issue!