Skip to content

Commit

Permalink
add slackClient.GetReaction method'
Browse files Browse the repository at this point in the history
  • Loading branch information
sho0126hiro committed Mar 17, 2023
1 parent 9f27c9e commit e12b7c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
10 changes: 10 additions & 0 deletions app/pkg/slack/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type Client interface {
PostEphemeral(ctx context.Context, channelID, userID, ts, message string) error
GetConversationReplies(ctx context.Context, channelID, ts string) ([]slack.Message, error)
GetUsersInfo(ctx context.Context, userID ...string) (*[]slack.User, error)
GetReaction(ctx context.Context, channelID, ts string, full bool) ([]slack.ItemReaction, error)

GetClient() *slack.Client
GetAppUserID() string
Expand Down Expand Up @@ -118,6 +119,15 @@ func (c *client) GetUsersInfo(ctx context.Context, userID ...string) (*[]slack.U
return users, nil
}

func (c *client) GetReaction(ctx context.Context, channelID, ts string, full bool) ([]slack.ItemReaction, error) {
return c.Client.GetReactionsContext(ctx, slack.ItemRef{
Channel: channelID,
Timestamp: ts,
}, slack.GetReactionsParameters{
Full: full,
})
}

func (c *client) GetClient() *slack.Client {
return c.Client
}
Expand Down
17 changes: 0 additions & 17 deletions app/pkg/slack/hoge_test.go

This file was deleted.

0 comments on commit e12b7c5

Please sign in to comment.