The gogram library exhibits incorrect behavior when multiple user IDs are passed to the Users field in the AddMessageHandler function. While the code works flawlessly when a single user ID is provided, it fails to handle multiple user IDs properly.
When multiple user IDs are specified in the Users field, the message handler is expected to be triggered for each user ID individually. However, in the current implementation, the message handler fails to execute for any of the provided user IDs.
This bug severely limits the functionality of the gogram library in scenarios where message handlers need to be registered for multiple users simultaneously.
1, Trigger the message handler by sending a relevant message.
Observe that the code fails to handle multiple user IDs correctly, and the message handler does not execute for any of the provided user IDs.
Expected Behavior
The expected behavior is that the gogram library should handle multiple user IDs properly in the AddMessageHandler function. Specifically, the message handler should be triggered individually for each user ID provided in the Users field.
Actual Behavior
Contrary to expectations, the current implementation of the gogram library fails to handle multiple user IDs correctly. When multiple user IDs are specified, the message handler does not execute for any of the provided user IDs.
Environment Details
Operating System: Linux
Go Version: 1.20
Additional Information
The version of the gogram library being used: github.com/amarnathcjd/gogram v0.0.0-20230616162607-84be75d00aa5
Steps Taken to Resolve the Issue
I have examined the code implementation thoroughly and ensured that the user IDs are correctly provided to the AddMessageHandler function. Additionally, I have reviewed the available documentation and examples for the gogram library but couldn't find any specific guidance on handling multiple user IDs in the AddMessageHandler function.
Bug Description
The
gogram
library exhibits incorrect behavior when multiple user IDs are passed to theUsers
field in theAddMessageHandler
function. While the code works flawlessly when a single user ID is provided, it fails to handle multiple user IDs properly.When multiple user IDs are specified in the Users field, the message handler is expected to be triggered for each user ID individually. However, in the current implementation, the message handler fails to execute for any of the provided user IDs.
This bug severely limits the functionality of the gogram library in scenarios where message handlers need to be registered for multiple users simultaneously.
To Reproduce
Steps to reproduce the behavior:
Users
field in theAddMessageHandler
function, as shown below:1, Trigger the message handler by sending a relevant message.
Expected Behavior
The expected behavior is that the gogram library should handle multiple user IDs properly in the AddMessageHandler function. Specifically, the message handler should be triggered individually for each user ID provided in the Users field.
Actual Behavior
Contrary to expectations, the current implementation of the gogram library fails to handle multiple user IDs correctly. When multiple user IDs are specified, the message handler does not execute for any of the provided user IDs.
Environment Details
Additional Information
The version of the gogram library being used:
github.com/amarnathcjd/gogram v0.0.0-20230616162607-84be75d00aa5
Steps Taken to Resolve the Issue
I have examined the code implementation thoroughly and ensured that the user IDs are correctly provided to the
AddMessageHandler
function. Additionally, I have reviewed the available documentation and examples for the gogram library but couldn't find any specific guidance on handling multiple user IDs in the AddMessageHandler function.