This pull request implements an enhancement to the send_typing_event function, allowing it to send typing notifications not only to Rocket.Chat channels but also to specific threads within those channels.
Purpose
The current implementation of send_typing_event is limited to notifying about typing events at the channel level. For some applications, such as chatbots replying within threads, it is desirable to indicate typing events at the thread level. This update enables an optional thread_id parameter to be passed along with the channel_id to send_typing_event. If a thread_id is provided, the typing event will be directed to the specified thread. The behavior of the function without the thread_id remains unchanged.
Implementation Details
The change involves minor modifications to:
The send_typing_event method in core.py, where I have added an optional thread_id parameter.
The SendTypingEvent class in methods.py, which now constructs the request payload with the thread_id if it is provided.
Backward compatibility has been maintained, ensuring that existing codebases using the send_typing_event function will continue to work as they did previously, without specifying a thread_id.
Testing & Compatibility
Testing was conducted on Rocket.Chat version 6.7.0, where the following behaviors were confirmed:
Typing events are correctly sent to channels when thread_id is not provided.
Typing events are correctly sent to the specified thread when thread_id is provided.
The absence of thread_id maintains the existing functionality without any adverse effects.
Your review and feedback on this addition would be greatly appreciated.
Summary
This pull request implements an enhancement to the
send_typing_event
function, allowing it to send typing notifications not only to Rocket.Chat channels but also to specific threads within those channels.Purpose
The current implementation of
send_typing_event
is limited to notifying about typing events at the channel level. For some applications, such as chatbots replying within threads, it is desirable to indicate typing events at the thread level. This update enables an optionalthread_id
parameter to be passed along with thechannel_id
tosend_typing_event
. If athread_id
is provided, the typing event will be directed to the specified thread. The behavior of the function without thethread_id
remains unchanged.Implementation Details
The change involves minor modifications to:
send_typing_event
method incore.py
, where I have added an optionalthread_id
parameter.SendTypingEvent
class inmethods.py
, which now constructs the request payload with thethread_id
if it is provided.Backward compatibility has been maintained, ensuring that existing codebases using the
send_typing_event
function will continue to work as they did previously, without specifying athread_id
.Testing & Compatibility
Testing was conducted on Rocket.Chat version 6.7.0, where the following behaviors were confirmed:
thread_id
is not provided.thread_id
is provided.thread_id
maintains the existing functionality without any adverse effects.Your review and feedback on this addition would be greatly appreciated.
Best regards,