Created
October 19, 2020 10:26
-
-
Save proclaim/38bb1b7624625a4edb8da4b0ac9f8325 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
import ( | |
"github.com/slack-go/slack" | |
) | |
func (s *SlackService) PostMessage(channel string, attachment slack.Attachment) (string, string, error) { | |
// ... your implementation here | |
return s.api.PostMessage( | |
channel, | |
slack.MsgOptionAttachments(attachment), | |
slack.MsgOptionAsUser(true), | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package service | |
import "github.com/slack-go/slack" | |
type SlackAPI interface { | |
PostMessage(channelID string, options ...slack.MsgOption) (string, string, error) | |
} | |
type SlackService struct { | |
api SlackAPI | |
} | |
func NewSlackService(api SlackAPI) *SlackService { | |
return &SlackService{ | |
api: api, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment