add delete flag
This commit is contained in:
parent
b390554348
commit
435f3fbb53
1 changed files with 13 additions and 0 deletions
13
main.go
13
main.go
|
|
@ -86,6 +86,19 @@ func main() {
|
||||||
handle, _ = bskyClient.ResolveHandle(s[1])
|
handle, _ = bskyClient.ResolveHandle(s[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *delete {
|
||||||
|
r, e := h.bsky.Bluesky.GetTelegramData(s[2])
|
||||||
|
if e == "" {
|
||||||
|
log.Printf("Found post %s in channel %d, deleting", s[2], r.ChannelID)
|
||||||
|
m := tgbotapi.NewDeleteMessage(r.ChannelID, r.MessageID)
|
||||||
|
h.tg.Send(m)
|
||||||
|
h.bsky.Bluesky.DeleteRecord([]string{s[2], s[1], "blue.zio.bsky2tg.post"})
|
||||||
|
} else {
|
||||||
|
log.Printf("Unable to find post %s on PDS", s[2])
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
postJSON := bskyClient.Bluesky.FetchPost(handle, s[2])
|
postJSON := bskyClient.Bluesky.FetchPost(handle, s[2])
|
||||||
p, _ := json.Marshal(postJSON.Record)
|
p, _ := json.Marshal(postJSON.Record)
|
||||||
h.ProcessPost(&models.Event{
|
h.ProcessPost(&models.Event{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue