AlertController
struct AlertController : APIRouteCollectionThe collection of alert endpoints, with routes for: - getting server time,, - getting public address-style announcements,, - getting notifications on alertwords, - getting notificaitons on incoming Fez messages.
- 
                  
                  Required. Registers routes to the incoming router. DeclarationSwift func registerRoutes(_ app: Application) throws
- 
                  getHashtagsHandler(_:Asynchronous) GET /api/v3/notification/hashtagsRetrieve info on hashtags that have been used. Throws A 5xx response should be reported as a likely bug, please and thank you.DeclarationSwift func getHashtagsHandler(_ req: Request) async throws -> [String]ParameterssearchStringPartial Hashtag string. Must have at least 1 character. Return Value
- 
                  globalNotificationHandler(_:Asynchronous) GET /api/v3/notification/globalGET /api/v3/notification/userRetrieve info on the number of each type of notification supported by Swiftarr. Throws A 5xx response should be reported as a likely bug, please and thank you.DeclarationSwift func globalNotificationHandler(_ req: Request) async throws -> UserNotificationDataReturn Value
- 
                  getActiveAnnouncementIDs(on:Asynchronous) DeclarationSwift func getActiveAnnouncementIDs(on req: Request) async throws -> [Int]
- 
                  
                  DeclarationSwift func getNewAlertWordCounts(hash: [String : RESPValue]) -> [UserNotificationAlertwordData]
- 
                  getModeratorNotifications(for:Asynchronouson: ) Returns a ModeratorNotificationData structure containing counts for open reports, seamails to @moderator with unread messages, and (if user is in TwitarrTeam) seamails to @TwitarrTeam with unread messages. If the user is not a moderator, returns nil. DeclarationSwift func getModeratorNotifications(for user: UserCacheData, on req: Request) async throws -> UserNotificationData .ModeratorNotificationData?
- 
                  
                  WS /api/v3/notification/socketCreates a notification socket for the user. The client of this socket will receive SocketNotificationDataupdates, generally when an event happens that would change a value in the user’sUserNotificationDatastruct.This socket only sends SocketNotificationDatamessages from the server to the client; there are no client-initiated messages defined for this socket.DeclarationSwift func createNotificationSocket(_ req: Request, _ ws: WebSocket)
- 
                  createAnnouncement(_:Asynchronous) POST /api/v3/notification/announcement/createCreate a new announcement. Requires TwitarrTeam access and above. When a new announcement is created the notification endpoints will start indicating the new announcement to all users. DeclarationSwift func createAnnouncement(_ req: Request) async throws -> HTTPStatusParametersrequestBodyReturn ValueHTTPStatus201 on success.
- 
                  getAnnouncements(_:Asynchronous) GET /api/v3/notification/announcementsReturns all active announcements, sorted by creation time, by default. URL Query Parameters - ?inactives=trueAlso return expired and deleted announcements. TwitarrTeam and above only.
 The purpose of the inactives flag is to allow for finding an expired announcement and re-activating it by changing its expire time. Doing so does not re-alert users who have already read it. DeclarationSwift func getAnnouncements(_ req: Request) async throws -> [AnnouncementData]Return ValueArray of AnnouncementData
- 
                  getSingleAnnouncement(_:Asynchronous) GET /api/v3/notification/announcement/IDReturns a single announcement, identified by its ID. TwitarrTeam and above only. Others should just use /api/v3/notification/announcements. Will return AnnouncementData for deleted announcements.Announcements shouldn’t be large, and there shouldn’t be many of them active at once (Less than 1KB each, if there’s more than 5 active at once people likely won’t read them). This endpoint really exists to support admins editing announcements. Throws 403 error if the user doesn’t have TwitarrTeam or higher access. 404 if no announcement with the given ID is found.DeclarationSwift func getSingleAnnouncement(_ req: Request) async throws -> AnnouncementDataParametersannouncementIDThe announcement to find Return Value
- 
                  editAnnouncement(_:Asynchronous) POST /api/v3/notification/announcement/ID/editEdits an existing announcement. Editing a deleted announcement will un-delete it. Editing an announcement does not change any user’s notification status for that announcement: if a user has seen the announcement already, editing it will not cause the user to be notified that they should read it again. Throws 403 error if the user is not permitted to edit.DeclarationSwift func editAnnouncement(_ req: Request) async throws -> AnnouncementDataParametersannouncementIDThe announcement to edit. Must exist. requestBodyReturn ValueThe updated AnnouncementCreateData
- 
                  deleteAnnouncement(_:Asynchronous) POST /api/v3/notification/announcement/ID/deleteDELETE /api/v3/notification/announcement/IDDeletes an existing announcement. Editing a deleted announcement will un-delete it TwitarrTeam and above only. Throws 403 error if the user is not permitted to delete.DeclarationSwift func deleteAnnouncement(_ req: Request) async throws -> HTTPStatusParametersannouncementIDParamThe announcement to delete. Return Value204 NoContent on success. 
- 
                  getDailyThemes(_:Asynchronous) GET /api/v3/notification/dailythemesReturns information about all the daily themes currently registered. Throws 403 error if the user is not permitted to delete.DeclarationSwift func getDailyThemes(_ req: Request) async throws -> [DailyThemeData]Return ValueAn array of DailyThemeDataon success.
 View on GitHub
            View on GitHub
           AlertController Structure Reference
      AlertController Structure Reference