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
{
"text": "ERROR",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "> Danny Torrence left the following review for your property:"
}
}
]
}
Is there any way to get that all info and post to a different channel
currently only can get text
switch interactiveCallback.Type {
// First we check if this is an CallbackEvent
case slackevents.CallbackEvent:
innerEvent := interactiveCallback.InnerEvent
switch ev := innerEvent.Data.(type) {
case *slackevents.MessageEvent:
err := handleMessageEvent(ev, client, errorChannelID)
if err != nil {
return err
}
}
default:
return errors.New("unsupported event type")
}
return nil
}
func handleMessageEvent(event *slackevents.MessageEvent, client *slack.Client, errorChannelID string) error {
botInfo, err := client.AuthTest()
if err != nil {
return fmt.Errorf("failed to get bot info: %w", err)
}
if event.User == botInfo.UserID {
log.Printf("Ignoring own bot message: %s", event.Text)
return nil
}
text := strings.ToLower(event.Text)
if strings.Contains(text, "error") {
_, _, _ = client.PostMessage(errorChannelID, slack.MsgOptionText(event.Text, false))
return nil
}
return nil
}
The text was updated successfully, but these errors were encountered:
here is the paylaod that I used to invoke Webhook
{
"text": "ERROR",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "> Danny Torrence left the following review for your property:"
}
}
]
}
Is there any way to get that all info and post to a different channel
currently only can get text
func handleInteractiveCallback(interactiveCallback slackevents.EventsAPIEvent, client *slack.Client, errorChannelID string) error {
}
func handleMessageEvent(event *slackevents.MessageEvent, client *slack.Client, errorChannelID string) error {
botInfo, err := client.AuthTest()
if err != nil {
return fmt.Errorf("failed to get bot info: %w", err)
}
}
The text was updated successfully, but these errors were encountered: