2024-10-19 17:39:04 +03:00
|
|
|
import Vapor
|
2024-10-19 18:14:11 +03:00
|
|
|
@preconcurrency import SwiftTelegramSdk
|
2024-10-19 17:39:04 +03:00
|
|
|
|
|
|
|
final class DefaultBotHandlers {
|
|
|
|
static func addHandlers() async {
|
|
|
|
await defaultBaseHandler()
|
|
|
|
}
|
|
|
|
|
|
|
|
private static func defaultBaseHandler() async {
|
|
|
|
await botActor.bot.dispatcher.add(TGBaseHandler({ update in
|
|
|
|
guard let message = update.message else { return }
|
|
|
|
let params: TGSendMessageParams = .init(chatId: .chat(message.chat.id), text: """
|
|
|
|
Help message
|
|
|
|
""")
|
|
|
|
try await botActor.bot.sendMessage(params: params)
|
|
|
|
}))
|
|
|
|
}
|
|
|
|
}
|