 /// Setting up the POST request with Telegram secret key.
 /// With a secret path to be sure that nobody else knows that URL.
 /// https://core.telegram.org/bots/api#setwebhook
-drop.post("telegram", telegramSecret) { request in
+droplet.post("telegram", telegramSecret) { request in
     /// If Telegram secret key is missing throw a bad request error.
     guard telegramSecret != "" else {
         throw Abort.custom(status: .badRequest, message: "Missing Telegram secret key!")

/// With a secret path to be sure that nobody else knows that URL.
/// This is step 2 of the following guide:
/// https://developers.facebook.com/docs/messenger-platform/guides/quick-start
drop.get("messenger", messengerSecret, "*") { request in
    guard request.data["hub.mode"]?.string == "subscribe" &&
        request.data["hub.verify_token"]?.string == messengerSecret,
        let challenge = request.data["hub.challenge"]?.string else {
        throw Abort.custom(status: .badRequest, message: "Missing Messenger data!")
    }
    
    return Response(status: .ok, headers: ["Content-Type": "text/plain"], body: challenge)
}

/// Run the Droplet.
drop.run()

}

/// Create the Droplet.
let droplet: Droplet = Droplet()

/// Read Telegram secret key from Config/secrets/app.json.
let telegramSecret = droplet.config["app", "telegram", "secret"]?.string ?? ""
let messengerSecret = droplet.config["app", "messenger", "secret"]?.string ?? ""

if telegramSecret == "" && messengerSecret == "" {
    /// Show errors in console.
    droplet.console.error("Missing secret keys!")
    droplet.console.error("Add almost one in Config/secrets/app.json")

    /// Throw missing secret key error.
    throw BotError.missingSecretKey
