telegram-auth-bot/Sources/TelegramModeratorBot/main.swift

18 lines
510 B
Swift
Raw Normal View History

2024-10-19 17:39:04 +03:00
// The Swift Programming Language
// https://docs.swift.org/swift-book
import Vapor
import SwiftTelegramSdk
var env = try Environment.detect()
try LoggingSystem.bootstrap(from: &env)
let eventLoop: EventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount * 4)
let app: Application = try await Application.make(env, Application.EventLoopGroupProvider.shared(eventLoop))
let botActor: TGBotActor = .init()
try await configure(app)
try await app.execute()
try await app.asyncShutdown()