diff --git a/Sources/TelegramVaporBot/Telegrammer/Errors/BotError.swift b/Sources/TelegramVaporBot/Telegrammer/Errors/BotError.swift index a5e52cc..2857147 100644 --- a/Sources/TelegramVaporBot/Telegrammer/Errors/BotError.swift +++ b/Sources/TelegramVaporBot/Telegrammer/Errors/BotError.swift @@ -46,7 +46,7 @@ public class BotError: ErrorCommon { self.description = "\(Self.self)" } - public init(type: Type, description: String = "", reason: String = "") { + public init(type: Type, description: String = "", reason: String = "") { self.type = type self.description = description self.reason = reason diff --git a/Sources/TelegramVaporBot/Telegrammer/Helpers/Constants.swift b/Sources/TelegramVaporBot/Telegrammer/Helpers/Constants.swift deleted file mode 100644 index e09f7c2..0000000 --- a/Sources/TelegramVaporBot/Telegrammer/Helpers/Constants.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Constants.swift -// Telegrammer -// -// Created by Givi Pataridze on 11/06/2018. -// - -import Foundation - -//public struct Const { -// static let MessageMaxLength: Int = 4096 -// static let CaptionMaxLength: Int = 200 -// static let WebhooksSupportedPorts: [Int] = [443, 80, 88, 8443] -// static let DownloadFileMaxSize: Int = 20 //TODO: rewrite in bytes, now in Mbytes -// static let UploadFileMaxSize: Int = 50 //TODO: rewrite in bytes, now in Mbytes -// ///Telegram may allow short bursts that go over this limit, but eventually you’ll begin receiving 429 errors. -// static let MessagesMaxPerSecondPerChat: Int = 1 -// static let MessagesMaxPerSecond: Int = 30 -// static let MessagesMaxPerMinutePerGroup: Int = 20 -// static let InlineQueryMaxResults: Int = 50 -// ///Beyond this cap telegram will simply ignore further formatting styles -// static let MessagesMaxEntities: Int = 100 -//} diff --git a/Sources/TelegramVaporBot/Telegrammer/Helpers/Error+Helpers.swift b/Sources/TelegramVaporBot/Telegrammer/Helpers/Error+Helpers.swift index b8bc463..0b5c29d 100644 --- a/Sources/TelegramVaporBot/Telegrammer/Helpers/Error+Helpers.swift +++ b/Sources/TelegramVaporBot/Telegrammer/Helpers/Error+Helpers.swift @@ -24,7 +24,7 @@ public extension Error { case .valueNotFound(_, let context): errorDescription = context.debugDescription @unknown default: - errorDescription = "Uknown DecodingError" + errorDescription = "Unknown DecodingError" } } else { errorDescription = "Cannot detect error type, providing default description:\n\(self.localizedDescription)" diff --git a/Telegram-bot-example/Sources/Telegram-bot-example/main.swift b/Telegram-bot-example/Sources/Telegram-bot-example/main.swift index 5266e54..59ef441 100644 --- a/Telegram-bot-example/Sources/Telegram-bot-example/main.swift +++ b/Telegram-bot-example/Sources/Telegram-bot-example/main.swift @@ -4,9 +4,9 @@ import TelegramVaporBot var env = try Environment.detect() try LoggingSystem.bootstrap(from: &env) let eventLoop: EventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount * 4) -let app: Application = .init(env, Application.EventLoopGroupProvider.shared(eventLoop)) +let app: Application = try await Application.make(env, Application.EventLoopGroupProvider.shared(eventLoop)) let TGBOT: TGBotConnection = .init() defer { app.shutdown() } try await configure(app) -try app.run() +try await app.execute()