18 lines
532 B
Swift
18 lines
532 B
Swift
import Vapor
|
|
import SwiftTelegramSdk
|
|
|
|
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)
|
|
}))
|
|
}
|
|
}
|