Extend api.ChannelMessage


I want to extend the ChannelMessage struct.
How can I do this?

I searched a lot but didn’t find any solution for this. This bothered me a lot.

Thank you for helping me.

Hello @Bahman.Binary,

Can you please elaborate on what you’re trying to achieve by extending the struct?

well, I want to add some props to the channel message for my own customization but I don’t know how to do this. I found out that there is some limitation in Golang struct extending and I don’t know how to get around this limitation.

The message format is defined in the server protobuf definitions.

Can you elaborate on what you’re trying to add? The message content is a json payload, you can add custom data there if needed.


I specially want to add a property named KickerId that actualy is caller variable’s UUID in function of KickGroupUsers of core_group.go file.

@sesposito Actually I want to detect who kicks another user in group.
If you have a better idea to do this, I welcome it.

Extending the message doesn’t seem to be the best approach here, we’ve created an internal ticket to add support for the kickerId to be added to the content of the message in a future release.


1 Like