Skip to content

Get ts of posted message, so it is possible to reply to it #91

@bence-nagy

Description

@bence-nagy

Consider the following use case:
A bot wants to post subsequent messages into a single thread within a slack channel.
So the first message would be a normal message, further messages would be thread replies to that message.

For this to work - as far as I can tell - you would need to get the identifier (which seems to be the ts property) of the first posted message. The slack API returns this information (see the documentation) in the form of "ts": "1503435956.000247".

If I had the value of that property then I could construct message objects with theirThreadId property set to the value returned by the first posted message, but this wrapper does not seems to expose that returned property.

The Post methods only seem to return with a bool (or a Task<bool>) and it seems that they do not modify the passed SlackMessage object, so the returned ts value is simply discarded. Is it so or am I missing something?

Would it be possible to somehow expose the ts property of a message once posted? Either via returning it from the Post methods or maybe storing it in the message object passed to the methods - so mutating the passed argument?

Or is there any workaround I can use? (Apart from using the slack API directly - which is of course a solution to my problem.)

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions