Fix comment
This commit is contained in:
parent
d116ba00bd
commit
b8188fbb2e
5
sn.go
5
sn.go
|
@ -86,14 +86,13 @@ func PostStoryToStackerNews(story *Story, options PostStoryOptions) (int, error)
|
||||||
SendStackerNewsEmbedToDiscord(story.Title, parentId)
|
SendStackerNewsEmbedToDiscord(story.Title, parentId)
|
||||||
|
|
||||||
comment := fmt.Sprintf(
|
comment := fmt.Sprintf(
|
||||||
"This link was posted by [%s](%s) %s on [HN](%s). It received %d points and %d comments.\n\n"+
|
"This link was posted by [%s](%s) %s on [HN](%s). It received %d points and %d comments.",
|
||||||
fmt.Sprintf("https://files.ekzyis.com/public/hn/hn_%d.png", story.ID),
|
|
||||||
story.By,
|
story.By,
|
||||||
HackerNewsUserLink(story.By),
|
HackerNewsUserLink(story.By),
|
||||||
humanize.Time(time.Unix(int64(story.Time), 0)),
|
humanize.Time(time.Unix(int64(story.Time), 0)),
|
||||||
HackerNewsItemLink(story.ID),
|
HackerNewsItemLink(story.ID),
|
||||||
story.Score, story.Descendants,
|
story.Score, story.Descendants,
|
||||||
)
|
) + fmt.Sprintf("\n\nhttps://files.ekzyis.com/public/hn/hn_%d.png", story.ID)
|
||||||
if _, err := sn.CreateComment(parentId, comment); err != nil {
|
if _, err := sn.CreateComment(parentId, comment); err != nil {
|
||||||
return -1, fmt.Errorf("error posting comment :%w", err)
|
return -1, fmt.Errorf("error posting comment :%w", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue