Skip to content

Commit

Permalink
update slack client
Browse files Browse the repository at this point in the history
  • Loading branch information
ShotaKitazawa committed Nov 9, 2024
1 parent 51c8a7a commit 60e5c03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/cheggaaa/pb v1.0.29
github.com/golang/mock v1.6.0
github.com/pkg/sftp v1.13.4
github.com/slack-go/slack v0.10.3
github.com/slack-go/slack v0.15.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
go.uber.org/zap v1.21.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ github.com/pkg/sftp v1.13.4/go.mod h1:LzqnAvaD5TWeNBsZpfKxSYn1MbjWwOsCIAFFJbpIsK
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/slack-go/slack v0.10.3 h1:kKYwlKY73AfSrtAk9UHWCXXfitudkDztNI9GYBviLxw=
github.com/slack-go/slack v0.10.3/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/slack-go/slack v0.15.0 h1:LE2lj2y9vqqiOf+qIIy0GvEoxgF1N5yLGZffmEZykt0=
github.com/slack-go/slack v0.15.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
Expand Down
12 changes: 6 additions & 6 deletions pkg/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ func (c Client) SendFileContent(ctx context.Context, channel, filename, content,
if channel == "" {
channel = c.defaultChannelId
}
params := slack.FileUploadParameters{
params := slack.UploadFileV2Parameters{
Title: title,
Filetype: "txt",
File: filename,
Filename: filename,
Content: content,
Channels: []string{channel},
FileSize: len(content),
Channel: channel,
}
file, err := c.client.UploadFile(params)
file, err := c.client.UploadFileV2(params)
if err != nil {
return err
}
c.log.Debug(fmt.Sprintf("sent file %s to Slack", file.Name))
c.log.Debug(fmt.Sprintf("sent file %s to Slack", file.Title))
return nil
}

0 comments on commit 60e5c03

Please sign in to comment.