diff --git a/Sources/Discord/Discord.swift b/Sources/Discord/Discord.swift index 2dfaad938..663116c9f 100644 --- a/Sources/Discord/Discord.swift +++ b/Sources/Discord/Discord.swift @@ -53,7 +53,7 @@ public class Bot { public internal(set) var cachedMessages = Set() /// Whether automatic sharding is enabled. If your bot is in 2500 or more guilds, this *must* be enabled. - public internal(set) var sharding: Bool + public let sharding: Bool /// The global allowed mentions. public static var allowedMentions = AllowedMentions.default @@ -611,7 +611,7 @@ public struct CacheManager { /// Has all caching capabilities enabled and a max message cache size of 1,500. public static let `default` = CacheManager(messages: 1500, users: true, members: true) - /// Has `users` and `members` caching capabilities enabled and a max message cache size of 500. + /// Has `users` caching capabilities disabled and a max message cache size of 500. public static let limited = CacheManager(messages: 500, users: false, members: true) /// Has all caching capabilities disabled and a max message cache size of 100. diff --git a/Sources/Discord/Http.swift b/Sources/Discord/Http.swift index eb10dfc7d..96be94940 100644 --- a/Sources/Discord/Http.swift +++ b/Sources/Discord/Http.swift @@ -1708,15 +1708,13 @@ class HTTPClient { } static func buildEndpoint(_ path: APIRoute, endpoint: String) -> String { - guard endpoint.starts(with: "/") else { - fatalError("Endpoint must start with /") - } + precondition(endpoint.starts(with: "/"), "Endpoint must start with /") return path.rawValue + endpoint } /// Creates the full HTTP endpoint. private func route(_ url: String, route: APIRoute = .base) -> String { - guard url.starts(with: "/") else { fatalError("URL route must begin with /") } + precondition(url.starts(with: "/"), "URL route must begin with /") return route.rawValue + url } diff --git a/Sources/Discord/Models/Guild.swift b/Sources/Discord/Models/Guild.swift index 2a17ed977..f7b00947e 100644 --- a/Sources/Discord/Models/Guild.swift +++ b/Sources/Discord/Models/Guild.swift @@ -1082,7 +1082,7 @@ public class Guild : Object, Hashable, Updateable { return try await bot!.http.getGuildTemplates(guildId: id) } - /// Updates the properties of the guild when received via gateway event`GUILD_UPDATE`. + /// Updates the properties of the guild when received via gateway event `GUILD_UPDATE` and possibly `GUILD_CREATE`. func update(_ data: JSON) { for (k, v) in data { switch k {