You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
based on https://api.slack.com/messaging/scheduling, I should receive a scheduled_message_id when using POST https://slack.com/api/chat.scheduleMessage this is in the API: ScheduleMessage(channelID, postAt string, options ...MsgOption) (string, string, error)
I would like to use this to delete my message using the API DeleteScheduledMessage(params *DeleteScheduledMessageParameters) (bool, error)
A workaround is to list the ScheduleMessage, but it would be nicer to get it in the return of ScheduleMessage().
My piece of code
channelID:="xxx"token:="xxx"api:=slack.New(token)
now:=time.Now().UnixNano() /1000000000timestampPlanned:=now+10//in 10 secondsfmt.Printf("Planning message at %d ; now=%d\n", timestampPlanned, now)
channelID, timestampMess, err:=api.ScheduleMessage(channelID, fmt.Sprintf("%d", timestampPlanned), slack.MsgOptionAttachments(slack.Attachment{Pretext: "test in future"}))
iferr!=nil {
panic("Could not send message: "+err.Error())
}
fmt.Printf("Message with Schedule sucessfully sent to channel %s at %s\n", channelID, timestampMess)
_, err=api.DeleteScheduledMessage(&slack.DeleteScheduledMessageParameters{Channel: channelID, ScheduledMessageID: "missing scheduled_message_id"})
iferr!=nil {
panic("Could not send message: "+err.Error())
}
fmt.Printf("Message with Schedule sucessfully deleted \n")
The text was updated successfully, but these errors were encountered:
Hello,
based on https://api.slack.com/messaging/scheduling, I should receive a
scheduled_message_id
when usingPOST https://slack.com/api/chat.scheduleMessage
this is in the API:ScheduleMessage(channelID, postAt string, options ...MsgOption) (string, string, error)
I would like to use this to delete my message using the API
DeleteScheduledMessage(params *DeleteScheduledMessageParameters) (bool, error)
A workaround is to list the ScheduleMessage, but it would be nicer to get it in the return of
ScheduleMessage()
.My piece of code
The text was updated successfully, but these errors were encountered: