Skip to content

Commit

Permalink
Fix DocC formatting, add missing record model
Browse files Browse the repository at this point in the history
- The "Getting Started With ATProtoKit" article had some misplaced
code examples. This commit fixes this issue.
- AppBskyLexicon.Feed.PostgateRecord was missing in the
recordLexicons array. This commit fixes that.
  • Loading branch information
MasterJ93 committed Aug 25, 2024
1 parent 5ff8f14 commit 6bc3201
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ Then use the ``ATProtoBluesky/createPostRecord(text:locales:replyTo:embed:labels

```swift
let postResult = try await atProtoBluesky.createPostRecord(text: "Hello Bluesky!")
print(postResult)
```

You should see the post in your Bluesky account once you run this code. When the method successfully completes, you'll receive a ``ComAtprotoLexicon/Repository/StrongReference`` object that contains the URI of the record (``ComAtprotoLexicon/Repository/StrongReference/recordURI``) and the content identifier hash of the record (``ComAtprotoLexicon/Repository/StrongReference/cidHash``).


let atProtoBluesky = ATProtoBluesky(atProtoKitInstance: atProto)

let postResult = try await atProtoBluesky.createPostRecord(text: "Hello Bluesky!")

print(postResult)
9 changes: 5 additions & 4 deletions Sources/ATProtoKit/ATProtoKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ public class ATProtoKit: ATProtoKitConfiguration {
/// If `canUseBlueskyRecords` is set to `false`, these will not be used.
private let recordLexicons: [ATRecordProtocol.Type] = [
AppBskyLexicon.Feed.GeneratorRecord.self, AppBskyLexicon.Feed.LikeRecord.self, AppBskyLexicon.Feed.PostRecord.self,
AppBskyLexicon.Feed.RepostRecord.self, AppBskyLexicon.Feed.ThreadgateRecord.self, AppBskyLexicon.Graph.BlockRecord.self,
AppBskyLexicon.Graph.FollowRecord.self, AppBskyLexicon.Graph.ListRecord.self, AppBskyLexicon.Graph.ListBlockRecord.self,
AppBskyLexicon.Graph.ListItemRecord.self, AppBskyLexicon.Graph.StarterpackRecord.self, AppBskyLexicon.Labeler.ServiceRecord.self,
ChatBskyLexicon.Actor.DeclarationRecord.self]
AppBskyLexicon.Feed.PostgateRecord.self, AppBskyLexicon.Feed.RepostRecord.self, AppBskyLexicon.Feed.ThreadgateRecord.self,
AppBskyLexicon.Graph.BlockRecord.self, AppBskyLexicon.Graph.FollowRecord.self, AppBskyLexicon.Graph.ListRecord.self,
AppBskyLexicon.Graph.ListBlockRecord.self, AppBskyLexicon.Graph.ListItemRecord.self, AppBskyLexicon.Graph.StarterpackRecord.self,
AppBskyLexicon.Labeler.ServiceRecord.self, ChatBskyLexicon.Actor.DeclarationRecord.self
]

/// Specifies the logger that will be used for emitting log messages.
public private(set) var logger: Logger?
Expand Down

0 comments on commit 6bc3201

Please sign in to comment.