TwitarrController
struct TwitarrController : APIRouteCollectionThe collection of /api/v3/twitarr/* route endpoint and handler functions related
to the twit-arr stream.
- 
                  
                  Empty stub register fn; Twarrt stream has been decomissioned. DeclarationSwift func registerRoutes(_ app: Application) throws
- 
                  
                  Required. Registers routes to the incoming router. DeclarationSwift func DISABLED_registerRoutes(_ app: Application) throws
- 
                  twarrtHandler(_:Asynchronous) GET /api/v3/twitarr/IDRetrieve the specified Twarrtwith full userLikeTypedata.Throws 404 error if the twarrt is not available.DeclarationSwift func twarrtHandler(_ req: Request) async throws -> TwarrtDetailDataParameterstwarrtIDin URL path Return ValueTwarrtDetailDatacontaining the specified twarrt.
- 
                  twarrtsHandler(_:Asynchronous) GET /api/v3/twitarrRetrieve an array of Twarrts. This query supports several optional query parameters.URL Query Parameters Parameters that filter the set of returned Twarrts. These may be combined (but only one instance of each); the result set will match all provided filters.- ?search=STRING- Only return twarrts whose text contains the search string.
- ?hashtag=STRING- Only return twarrts whose text contains the given #hashtag. The # is not required in the value.
- ?mentions=STRING- Only return twarrts that @mention the given username. The @ is not required in the value.
- ?mentionSelf=true- Matches posts whose text contains a @mention of the current user.
- ?byUser=ID- Only return twarrts authored by the given user.
- ?byUsername=STRING- Only return twarrts authored by the given user.
- ?bookmarked=true- Only return twarrts the user has bookmarked.
- ?replyGroup=ID- Only return twarrts in the given replyGroup. The twarrt whose twarrtID == ID is always considered to be in the reply group, even if there are no replies to it.
- ?hideReplies=true- Filter out twarrts that are replies to other twarrts. Will still return the twarrt that starts a replyGroup. Ignored if- replyGroupoption is used.
- ?likeType=[like, laugh, love, all]- Only return twarrts the user has reacted to.
 Parameters that set the anchor. The anchor can be a specific Twarrt, aDate, or the first or last twarrt in the stream. These parameters are mutually exclusive. The default anchor if none is specified is?from=last. If you specify a twarrt ID as an anchor, that twarrt does not need to pass the filter params (see above).- ?after=ID- the ID of the twarrt after which the retrieval should start (newer).
- ?before=ID- the ID of the twarrt before which the retrieval should start (older).
- ?afterDate=DATE- the timestamp after which the retrieval should start (newer).
- ?beforeDate=DATE- the timestamp before which the retrieval should start (older).
- ?from=STRING- retrieve starting from “first” or “last”.
 These parameters operate on the filtered set of twarrts, starting at the anchor, above. These parameters can be used to implement paging that is invariant to new results being added while displaying filtered twarrts. That is, for an initial call with ?hashtag=joco&from=last, on subsequent calls you can call?hashtag=joco&before=<id of first result>&start=50and you will get the 50 twarrts containing the #joco hashtag, occuring immediately before the 50 results returned in the first call– even if there have been more twarrts posted with the hashtag in the interim.- ?start=INT- the offset from the anchor to start. Offset only counts twarrts that pass the filters.
- ?limit=INT- the maximum number of twarrts to retrieve: 1-200, default is 50
 A query without additional parameters defaults to ?limit=50&from=last, the 50 most recent twarrts.DATEvalues can be eitherTimeIntervalvalues (Doubles) since epoch, or ISO8601 string representations including milliseconds (“yyyy-MM-dd’T'HH:mm:ss.SSSXXXXX”). The numeric value method is recommended.Note It is highly recommended that clients use after=IDorbefore=IDwhere possible.TwarrtID’s are Int values and thus unambiguous.DATEvalues are accurate only within 1 millisecond and are therefore prone to rounding errors. To ensure that all twarrts of interest are returned when sending a date based on the value found in a twarrt’s timestamp, it is recommended that 1 millisecond be added (if retrieving older) or subtracted (if retrieving newer) from that value for the query. You will almost certainly receive the original anchor twarrt again, but it will also ensure that any others possibly created within the same millisecond will not be omitted.Note Blocks are always applied to the search results. User mutes are applied to the search results unless a filter is used that involves users or twarrts the user has previously interacted with ( inBarrel,likeType,bookmarked) or matches users by name (byuser).Throws 400 error if a date parameter was supplied and is in an unknown format. DeclarationSwift func twarrtsHandler(_ req: Request) async throws -> [TwarrtData]Return ValueAn array of TwarrtDatacontaining the requested twarrts.
- 
                  bookmarkAddHandler(_:Asynchronous) POST /api/v3/twitarr/ID/bookmarkAdd a bookmark of the specified Twarrt.Throws 400 error if the twarrt is already bookmarked.DeclarationSwift func bookmarkAddHandler(_ req: Request) async throws -> HTTPStatusParameterstwarrtIDin URL path Return Value201 Created on success. 
- 
                  bookmarkRemoveHandler(_:Asynchronous) POST /api/v3/twitarr/ID/bookmark/removeRemove a bookmark of the specified Twarrt.Throws 400 error if the user has not bookmarked any twarrts.DeclarationSwift func bookmarkRemoveHandler(_ req: Request) async throws -> HTTPStatusParameterstwarrtIDin URL path Return Value204 NoContent on success. 
- 
                  replyHandler(_:Asynchronous) POST /api/v3/twitarr/:twarrt_ID/replyCreate a Twarrtas a reply to an existing twarrt. If the replyTo twarrt is in quarantine, the post is rejected.Note Replies work differently than on Twitter. Here, any twarrt that is replied to becomes a reply-group, and all twarrts replying to ANY twarrt in the reply-group are added to that reply-group. Reply-groups are not nestable, and every twarrt is a member of at most one reply group. Twarrts that are not replies themselves are eligible to become the head of a reply-group if they are replied to. Twarrts that are replies are placed in a reply-group whose ID is the twarrt ID of the first twarrt in the group. This may not be the ID of the twarrt they’re directly replying to. If B is created as a reply to A, and C is created as a reply to B, C is actually placed in a reply-group with both A and B.One feature of this system for replies is that TwarrtData.replyGroupIDcan be used to discern whether a twarrt is part of a reply-group or not.Throws 400 error if the replyTo twarrt is in quarantine.DeclarationSwift func replyHandler(_ req: Request) async throws -> ResponseParameterstwarrtIDin URL path. The twarrt to reply to. requestBodyReturn ValueA TwarrtDatacontaining the twarrt’s contents and metadata. HTTP 201 status if successful.
- 
                  twarrtCreateHandler(_:Asynchronous) POST /api/v3/twitarr/createCreate a new Twarrtin the twitarr stream.DeclarationSwift func twarrtCreateHandler(_ req: Request) async throws -> ResponseParametersrequestBodyReturn ValueTwarrtDatacontaining the twarrt’s contents and metadata. HTTP 201 status if successful.
- 
                  twarrtDeleteHandler(_:Asynchronous) POST /api/v3/twitarr/ID/deleteDELETE /api/v3/twitarr/IDDelete the specified Twarrt.Throws 403 error if the user is not permitted to delete.DeclarationSwift func twarrtDeleteHandler(_ req: Request) async throws -> HTTPStatusParameterstwarrtIDin URL path. The twarrt to delete. Return Value204 No Content on success. 
- 
                  twarrtReportHandler(_:Asynchronous) POST /api/v3/twitarr/ID/reportCreate a Reportregarding the specifiedTwarrt. If the twarrt has reached the report threshold for auto-quarantining, it is quarantined.Note The accompanying report message is optional on the part of the submitting user, but the ReportDatais mandatory in order to allow one. If there is no message, sent an empty string in the.messagefield.Throws 400 error if user has already submitted report. DeclarationSwift func twarrtReportHandler(_ req: Request) async throws -> HTTPStatusParameterstwarrtIDin URL path. The twarrt to report. requestBodyReturn Value201 Created on success. 
- 
                  twarrtLaughHandler(_:Asynchronous) POST /api/v3/twitarr/ID/laughAdd a “laugh” reaction to the specified Twarrt. If there is an existingLikeTypereaction by the user, it is replaced.Throws 403 error if user is the twarrt’s creator.DeclarationSwift func twarrtLaughHandler(_ req: Request) async throws -> TwarrtDataParameterstwarrtIDin URL path. Return ValueTwarrtDatacontaining the updated like info.
- 
                  twarrtLikeHandler(_:Asynchronous) POST /api/v3/twitarr/ID/likeAdd a “like” reaction to the specified Twarrt. If there is an existingLikeTypereaction by the user, it is replaced.Throws 403 error if user is the twarrt’s creator.DeclarationSwift func twarrtLikeHandler(_ req: Request) async throws -> TwarrtDataParameterstwarrtIDin URL path. Return ValueTwarrtDatacontaining the updated like info.
- 
                  twarrtLoveHandler(_:Asynchronous) POST /api/v3/twitarr/ID/loveAdd a “love” reaction to the specified Twarrt. If there is an existingLikeTypereaction by the user, it is replaced.Throws 403 error if user is the twarrt’s creator.DeclarationSwift func twarrtLoveHandler(_ req: Request) async throws -> TwarrtDataParameterstwarrtIDin URL path. Return ValueTwarrtDatacontaining the updated like info.
- 
                  twarrtReactHandler(_:AsynchronouslikeType: ) Add a reaction to the specified Twarrt. If there is an existingLikeTypereaction by the user, it is replaced. All 3 reaction handlers use this function as they all do the same thing.Throws 403 error if user is the twarrt’s creator.DeclarationSwift func twarrtReactHandler(_ req: Request, likeType: LikeType) async throws -> TwarrtDataParametersreqThe incoming Request, provided automatically.likeTypeThe type of reaction being set. Return ValueTwarrtDatacontaining the updated like info.
- 
                  twarrtUnreactHandler(_:Asynchronous) POST /api/v3/twitarr/ID/unreactDELETE /api/v3/twitarr/ID/reactionRemove a LikeTypereaction from the specifiedTwarrt.Throws 403 error if user is is the twarrt’s creator. 404 if no twarrt with the ID is found.DeclarationSwift func twarrtUnreactHandler(_ req: Request) async throws -> TwarrtDataParameterstwarrtIDin URL path. Return ValueTwarrtDatacontaining the updated like info.
- 
                  twarrtUpdateHandler(_:Asynchronous) POST /api/v3/twitarr/ID/updateUpdate the specified Twarrt.Throws 403 error if user is not twarrt owner or has read-only access.DeclarationSwift func twarrtUpdateHandler(_ req: Request) async throws -> TwarrtDataParameterstwarrtIDin URL path. requestBodyReturn ValueTwarrtDatacontaining the twarrt’s contents and metadata.
- 
                  buildTwarrtData(from:AsynchronoususerID: on: ) DeclarationSwift func buildTwarrtData(from twarrt: Twarrt, userID: UUID, on req: Request) async throws -> TwarrtData
- 
                  
                  DeclarationSwift func buildTwarrtData( from twarrts: [Twarrt], userID: UUID, on req: Request, mutewords: [String]? = nil, assumeBookmarked: Bool? = nil, matchHashtag: String? = nil ) async throws -> [TwarrtData]
- 
                  
                  DeclarationSwift func processTwarrtMentions(twarrt: Twarrt, editedText: String?, isCreate: Bool = false, on req: Request) async throws
 View on GitHub
            View on GitHub
           TwitarrController Structure Reference
      TwitarrController Structure Reference