Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram send issue if "chatid" contains a minus at the beginning #9831

Closed
8 of 15 tasks
FerFemNemBem opened this issue Nov 12, 2020 · 2 comments
Closed
8 of 15 tasks
Assignees
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended

Comments

@FerFemNemBem
Copy link

diff.txt

PROBLEM DESCRIPTION

A clear and concise description of what the problem is.
Sending a Telegram message fails if the chatid starts with a minus sign.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

  • Read the Contributing Guide and Policy and the Code of Conduct
  • Searched the problem in issues
  • Searched the problem in the docs
  • Searched the problem in the forum
  • Searched the problem in the chat
  • Device used (e.g., Sonoff Basic): _____
  • Tasmota binary firmware version number used: 9.1.0
    • Pre-compiled
    • Self-compiled
      • IDE / Compiler used: VSCode + PIO
  • Flashing tools used: _____
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:


  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:


  • Provide the output of this command: Status 0:
  STATUS 0 output here:


  • Provide the output of the Console log output when you experience your issue; if applicable:
    (Please use weblog 4 for more debug information)
Console output here:
18:37:27 CMD: tmchatid -123456789
18:37:27 MQT: keller/heizung/warmwassersensor/RESULT = {"TmChatId":"-123456789"}
18:37:49 CMD: tmsend test
18:37:49 SRC: WebConsole from 192.168.178.62
18:37:49 CMD: Group 0, Index 1, Command "TMSEND", Data "test"
18:37:49 TGM: sendMessage
18:37:49 TGM: Cmnd bot54354356:FGHRWHTHJ-GTERZER_DFGFHGHGFHFGHJHJ/sendMessage?chat_id=123456789&text=test
18:37:50 TGM: Connected in 983 ms, max ThunkStack used 4484
18:37:51 TGM: Response {"ok":false,"error_code":400,"description":"Bad Request: chat not found"}

TO REPRODUCE

Steps to reproduce the behavior:
Telegram uses for group chats IDs with a minus at the beginning "tmchatid -123456789"
If you doublecheck at the console using "chatid" you will see the correct ID.
If you want to send a message to this chat it will fail.
The reason seems to be the following commit: 40ad4f7#diff-50b7d293806b164cb42a4bc8d06a84fbcacaf1803a6d30e42701f62367bdbdc4

Inside the commit the "chat_id" was changed from String to "uint_32_t".
Before this commit it was working also with chatIDs using a minus sign at the beginning.
Changing the "chat_id" from "uint_32_t" to "int_32_t" would fix this issue.
I have appended a diff.

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.
Message should be sent.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

@ascillato2 ascillato2 added the troubleshooting Type - Troubleshooting label Nov 13, 2020
@arendst arendst self-assigned this Nov 13, 2020
@arendst arendst added bug Type - Confirmated Bug and removed troubleshooting Type - Troubleshooting labels Nov 13, 2020
@arendst
Copy link
Owner

arendst commented Nov 13, 2020

Thx! your solution will fix it. I'll update soon.

arendst added a commit that referenced this issue Nov 13, 2020
Fixed Telegram group chatid not supported (#9831)
@arendst arendst added the fixed Result - The work on the issue has ended label Nov 13, 2020
@FerFemNemBem
Copy link
Author

Thank you for fixing that fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests

3 participants