dev vouch dev on at. thats about it atvouch.dev
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

make cli align with record format

Luna 9b4d464c ce65f198

+17 -2
+17 -2
cli/main.go
··· 203 203 return fmt.Errorf("invalid DID from resolution: %w", err) 204 204 } 205 205 206 + // Check if a vouch already exists for this subject 207 + var existingRecord struct { 208 + URI string `json:"uri"` 209 + Value any `json:"value"` 210 + } 211 + err = client.Get(ctx, "com.atproto.repo.getRecord", map[string]any{ 212 + "repo": session.Data.AccountDID, 213 + "collection": "dev.atvouch.graph.vouch", 214 + "rkey": subjectDID.String(), 215 + }, &existingRecord) 216 + if err == nil { 217 + fmt.Printf("You have already vouched for %s (%s)\n", handle, subjectDID) 218 + fmt.Printf("Record: %s\n", existingRecord.URI) 219 + return nil 220 + } 221 + 206 222 // Create the vouch record 207 - rkey := syntax.NewTIDNow(0) 208 223 record := map[string]any{ 209 224 "$type": "dev.atvouch.graph.vouch", 210 225 "subject": subjectDID.String(), ··· 218 233 if err := client.Post(ctx, "com.atproto.repo.createRecord", map[string]any{ 219 234 "repo": session.Data.AccountDID, 220 235 "collection": "dev.atvouch.graph.vouch", 221 - "rkey": rkey.String(), 236 + "rkey": subjectDID.String(), 222 237 "record": record, 223 238 }, &createResp); err != nil { 224 239 return fmt.Errorf("creating vouch record: %w", err)