@@ -16,6 +16,7 @@ import (
16
16
"os"
17
17
"os/signal"
18
18
"path"
19
+ "strconv"
19
20
"strings"
20
21
"syscall"
21
22
"time"
@@ -262,7 +263,7 @@ func readJetstreamMessage(ctx context.Context, jetstreamMessageEncoded []byte, b
262
263
imageURL = fmt .Sprintf ("https://cdn.bsky.app/img/feed_fullsize/plain/%s/%s" , bskyMessage .Did , bskyMessage .Commit .Record .Embed .Images [0 ].Image .Ref .Link )
263
264
}
264
265
265
- err = sendToSlack (ctx , jetstreamMessageStr , bskyMessage , imageURL , * profile )
266
+ err = sendToSlack (ctx , jetstreamMessageStr , bskyMessage , imageURL , * profile , postTime )
266
267
if err != nil {
267
268
slog .Error ("slack error" , "err" , err )
268
269
}
@@ -286,14 +287,16 @@ func getBskyProfile(ctx context.Context, bskyMessage BskyMessage, bsky *bluesky.
286
287
return profile , nil
287
288
}
288
289
289
- func sendToSlack (ctx context.Context , jetstreamMessageStr string , bskyMessage BskyMessage , imageURL string , profile bluesky.Profile ) error {
290
+ func sendToSlack (ctx context.Context , jetstreamMessageStr string , bskyMessage BskyMessage , imageURL string , profile bluesky.Profile , postTime time. Time ) error {
290
291
attachments := []SlackAttachment {
291
292
{
292
293
AuthorName : fmt .Sprintf ("%s (@%s)" , profile .Name , profile .Handle ),
293
294
AuthorIcon : profile .AvatarURL ,
294
295
AuthorLink : fmt .Sprintf ("https://bsky.app/profile/%s" , profile .Handle ),
295
296
Text : fmt .Sprintf ("%s\n <%s|View post on Bluesky ↗>" , bskyMessage .Commit .Record .Text , bskyMessage .toURL (& profile .Handle )),
296
297
ImageUrl : imageURL ,
298
+ Footer : "Posted" ,
299
+ Ts : strconv .FormatInt (postTime .Unix (), 10 ),
297
300
},
298
301
}
299
302
0 commit comments