jptsantossilva / BEC

Trading bot for Binance exchange using EMA cross strategy on 1D, 4h, and 1h timeframes. Analyzes 4yrs of coin prices to select profitable EMA cross. Auto-identifies accumulation and bullish phases. Has web dashboard and Telegram alerts.
MIT License
40 stars 10 forks source link

Some Telegram messages are not being sent #8

Closed donmega closed 1 year ago

donmega commented 1 year ago

Hi,

I am trying out your bot, so for it looks great! There is one problem tho. It looks like some messages are not being sent to Telegram. This is what i see in the main.log file:

2023-03-27 09:00:27 PM - send_telegram_message - An Http Error occurred:HTTPError('401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVybi[SNIP]%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3E%E2%8F%B9+Binance+Trader+Bot+-+End%3C%2Fpre%3E&parse_mode=HTML')
Traceback (most recent call last):
  File "/home/binance/telegram.py", line 174, in send_telegram_message
    resp.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy[SNIP]%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3E%E2%8F%B9+Binance+Trader+Bot+-+End%3C%2Fpre%3E&parse_mode=HTML
2023-03-27 09:00:28 PM - send_telegram_message - An Http Error occurred:HTTPError('401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy[SNIP]%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3EExecution+Time%3A+24s%3C%2Fpre%3E&parse_mode=HTML')
Traceback (most recent call last):
  File "/home/binance/telegram.py", line 174, in send_telegram_message
    resp.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy[SNIP]%22%20/sendMessage?chat_id=[SNIP]+&text=%3Cpre%3EExecution+Time%3A+24s%3C%2Fpre%3E&parse_mode=HTML

I've cut out parts of my telegram ID with [SNIP]

I am sure the telegram ID is correct, because i am receiving the 4h messages. I use the same telegram id for all 3 timeranges (4h, 1h, 1d). Is that ok?

Please let me know if i am doing something wrong on my side.

Thank you, and keep up the great job!

jptsantossilva commented 1 year ago

Hi, Telegram chat id is the same for the 3 instances. Did you logout and login after inserted environment vars? It only applies after doing that. Did you click on the start button on all the telegram chat bots?

On Mon, Mar 27, 2023 at 10:22 PM donmega @.***> wrote:

Hi,

I am trying out your bot, so for it looks great! There is one problem tho. It looks like some messages are not being sent to Telegram. This is what i see in the main.log file:

2023-03-27 09:00:27 PM - send_telegram_message - An Http Error occurred:HTTPError('401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVybi[SNIP]%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3E%E2%8F%B9+Binance+Trader+Bot+-+End%3C%2Fpre%3E&parse_mode=HTML https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVybi%5BSNIP%5D%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3E%E2%8F%B9+Binance+Trader+Bot+-+End%3C%2Fpre%3E&parse_mode=HTML') Traceback (most recent call last): File "/home/binance/telegram.py", line 174, in send_telegram_message resp.raise_for_status() File "/usr/lib/python3/dist-packages/requests/models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy[SNIP]%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3E%E2%8F%B9+Binance+Trader+Bot+-+End%3C%2Fpre%3E&parse_mode=HTML 2023-03-27 https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy%5BSNIP%5D%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3E%E2%8F%B9+Binance+Trader+Bot+-+End%3C%2Fpre%3E&parse_mode=HTML2023-03-27 09:00:28 PM - send_telegram_message - An Http Error occurred:HTTPError('401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy[SNIP]%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3EExecution+Time%3A+24s%3C%2Fpre%3E&parse_mode=HTML https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy%5BSNIP%5D%22%20/sendMessage?chat_id=[SNIP]%22+&text=%3Cpre%3EExecution+Time%3A+24s%3C%2Fpre%3E&parse_mode=HTML') Traceback (most recent call last): File "/home/binance/telegram.py", line 174, in send_telegram_message resp.raise_for_status() File "/usr/lib/python3/dist-packages/requests/models.py", line 960, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy[SNIP]%22%20/sendMessage?chat_id=[SNIP]+&text=%3Cpre%3EExecution+Time%3A+24s%3C%2Fpre%3E&parse_mode=HTML https://api.telegram.org/bot2137019384:AAEvrirNoTAUDxZVy%5BSNIP%5D%22%20/sendMessage?chat_id=[SNIP]+&text=%3Cpre%3EExecution+Time%3A+24s%3C%2Fpre%3E&parse_mode=HTML

I've cut out parts of my telegram ID with [SNIP]

I am sure the telegram ID is correct, because i am receiving the 4h messages. I use the same telegram id for all 3 timeranges (4h, 1h, 1d). Is that ok?

Please let me know if i am doing something wrong on my side.

Thank you, and keep up the great job!

— Reply to this email directly, view it on GitHub https://github.com/jptsantossilva/Binance-Trading-bot-EMA-Cross/issues/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ6GHEZTCTXZX6TQQWJYKO3W6IAJ7ANCNFSM6AAAAAAWJVRQM4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Melhores Cumprimentos / Best Regards João Santos Silva