Skip to content

Commit

Permalink
Made the connections to the slack App/Bot public
Browse files Browse the repository at this point in the history
  • Loading branch information
robiball committed Sep 10, 2018
1 parent 01ca448 commit 827bba2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions wrapper/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ type SlackWrapper interface {

// Slack is a wrapper around the Slack App and RTM APIs
type Slack struct {
app *slack.Client
bot *slackbot.Bot
App *slack.Client
Bot *slackbot.Bot
}

// New takes an app and bot token, verifies the connection and
Expand All @@ -34,12 +34,12 @@ func New(appToken, botToken string) (*Slack, error) {
if _, err = slackBot.Client.AuthTest(); err != nil {
return nil, err
}
return &Slack{app: slackApp, bot: slackBot}, nil
return &Slack{App: slackApp, Bot: slackBot}, nil
}

// OpenDialog opens a Dialog inside Slack
func (s *Slack) OpenDialog(triggerID string, dialog slack.Dialog) error {
err := s.app.OpenDialog(triggerID, dialog)
err := s.App.OpenDialog(triggerID, dialog)
if err != nil {
fmt.Errorf("error opening dialog. %s", err)
return err
Expand All @@ -49,6 +49,6 @@ func (s *Slack) OpenDialog(triggerID string, dialog slack.Dialog) error {

// SendMessage posts a message to Slack that is visible to everyone in the channel
func (s *Slack) SendMessage(message, channel string) {
msg := s.bot.RTM.NewOutgoingMessage(message, fmt.Sprintf("#%s", channel))
s.bot.RTM.SendMessage(msg)
msg := s.Bot.RTM.NewOutgoingMessage(message, fmt.Sprintf("#%s", channel))
s.Bot.RTM.SendMessage(msg)
}

0 comments on commit 827bba2

Please sign in to comment.