Make send_* functions return an instance of the message sent
Or is there already a way to do this? For clarification I need send methods like send_video to return an instance of the message it sent with Message.ID already set could be added to response.Message ?
https://github.com/krypton-byte/neonize/blob/863306cadfce1d1e82950bbdfca2f17f3d4605f2/neonize/aioze/client.py#L942-L946
The message gotten from the message builder should be referenced (to be reused) then after the message is successfully sent, the MessageWithContextInfo is extracted from the message and then patched into a new message class with Info and Info.MessageSource set from response.ID and (Chat & Sender) JID respectively the message should then be patched into the response; https://github.com/krypton-byte/neonize/blob/863306cadfce1d1e82950bbdfca2f17f3d4605f2/neonize/proto/Neonize_pb2.pyi#L719 with the attribute response.Message
~~This would have been easier if we can extract any MessageWithContextInfo without knowing what message type it is specifically (I guess it's possible)~~ It seems there's already a function in https://github.com/krypton-byte/neonize/blob/863306cadfce1d1e82950bbdfca2f17f3d4605f2/neonize/utils/message.py#L11 that does that So we can do the the patching in client.send_message
@krypton-byte your thoughts?
@krypton-byte I can't modify SendResponse since it's connected with the go code and I honestly have no idea how that works :neckbeard:
Returning a new object instead of SendResponse since protobuf doesn't support inheritance, would break other users code. (especially if they have strict type checking enabled)
Fixed in #127