atc0005 / go-teams-notify

A package to send messages to a Microsoft Teams channel
MIT License
100 stars 17 forks source link

Update thread message #199

Open Alansyf opened 1 year ago

Alansyf commented 1 year ago

Hi

I am using below sample code and it will work.

msg, err := adaptivecard.NewSimpleMessage(msgText, msgTitle, true)
    if err != nil {
        log.Printf(
            "failed to create message: %v",
            err,
        )
        os.Exit(1)
    }

    // Send the message with default timeout/retry settings.
    if err := mstClient.Send(webhookUrl, msg); err != nil {
        log.Printf(
            "failed to send message: %v",
            err,
        )
        os.Exit(1)
    }

Is that possible that I can get the "parentMessageId", so next time in my code, I can have my logic, i can do "reply" the same message thread, rather than create a new message.

image
atc0005 commented 1 year ago

@Alansyf: Is that possible that I can get the "parentMessageId", so next time in my code, I can have my logic, i can do "reply" the same message thread, rather than create a new message.

Unfortunately, I'm not aware of a way to make this work.

The current implementation uses a webhook to deliver a message. While the remote endpoint accepts the message and confirms receipt, it doesn't provide a message ID in the response.

This said, if you come across a way to perform the action that we can implement in this library I'm interested in adding it.

sgaunet commented 1 year ago

Hi,

I'm interested too. I just read the documentation quickly.

With send chatmessage we can get the id of the message and send reply by using the id of the chat message.

Here is a usefull link too