-
Notifications
You must be signed in to change notification settings - Fork 64
Using Swift REPL for calling API methods
Andrey Fidrya edited this page Jun 8, 2016
·
8 revisions
A read–eval–print loop (REPL) allows executing arbitrary Swift commands and seeing their output instantly.
Clone and build the library:
git clone https://github.com/zmeyc/telegram-bot-swift.git
cd telegram-bot-swift
swift build
Run Swift REPL:
swift -I .build/debug
REPL prompt will appear:
Welcome to Apple Swift version 3.0-dev (LLVM 752e1430fc, Clang 3987718dae, Swift 36739f7b57). Type :help for assistance.
1>
Init the bot instance using a token obtained from BotFather:
import TelegramBot
let bot = TelegramBot(token: "paste_bot_token_here")