Skip to content

Commit

Permalink
Adding noticement to interactive channel
Browse files Browse the repository at this point in the history
  • Loading branch information
SLASHLogin committed Oct 16, 2017
1 parent 65f613a commit e2461fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,13 @@ func downloadFromUrl(dUrl string, filename string, path string, channelId string
contentTypeParts := strings.Split(contentType, "/")
if contentTypeParts[0] != "image" && contentTypeParts[0] != "video" {
fmt.Println("No image or video found at", dUrl)
if SendNoticesToInteractiveChannels == true {
content := fmt.Sprintf("No image or video found at", dUrl)
_, err := dg.ChannelMessageSend(ChannelId,content)
if err != nil {
fmt.Println("Failed to send notice to", channelId, "-", err)
}
}
return true
}

Expand Down

1 comment on commit e2461fc

@SLASHLogin
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know this language so much but accordingly to your code it'd be good. Anyway, just correct this or something like that.

Please sign in to comment.