             "\n" +
             "To reverse words, use /word_reverse word1 word2 word3..."
         
-        bot.respondPrivatelySync(helpText,
-            groupText: "\(message.from.firstName), please find usage instructions in a personal message.")
+        bot.respondPrivatelyAsync(helpText,
+            groupText: "\(message.from.first_name), please find usage instructions in a personal message.")
     }
     
     func settings() {

import Foundation
import TelegramBot

let environment = NSProcessInfo.processInfo().environment
guard let token = environment["WORD_REVERSE_BOT_TOKEN"] else {
    fatalError("Please set WORD_REVERSE_BOT_TOKEN environment variable")
}

let bot = TelegramBot(token: token)


            "\n" +
            "No settings are available for this bot."
        
        bot.respondPrivatelyAsync(settingsText,
            groupText: "\(message.from.first_name), please find a list of settings in a personal message.")
    }

    func partialMatchHandler(args: Arguments) {
        bot.respondSync("❗ Part of your input was ignored: \(args.scanRestOfString())")
    }

    func reverseText(args: Arguments) -> Bool {
        guard started else { return false }
        
        let text = args.scanRestOfString()
	
        bot.respondAsync(String(text.characters.reversed()))
		return true
    }
    
    func reverseWords(args: Arguments) -> Bool {
        guard started else { return false }
        
        let words = args.scanWords()
        switch words.isEmpty {
        case true: bot.respondAsync("Please specify some words to reverse.")
		case false: bot.respondAsync(words.reversed().joined(separator: " "))
        }
		return true
    }
}

let controller = Controller(bot: bot)

let router = Router(bot: bot)
router["start"] = controller.start
router["stop"] = controller.stop
router["help"] = controller.help
router["settings"] = controller.settings
router["reverse", slash: .Required] = controller.reverseText
router["word_reverse"] = controller.reverseWords
// Default handler
router.unknownCommand = controller.reverseText

print("Ready to accept commands")
while let message = bot.nextMessageSync() {
	print("--- update_id: \(bot.lastUpdate!.update_id)")
	print("message: \(message.debugDescription)")
	print("command: \(bot.lastCommand.unwrapOptional)")
	
	if let command = bot.lastCommand {
		try router.process(command)
	}
}
fatalError("Server stopped due to error: \(bot.lastError)")
