telebot

Async Telegram Bot API Client


Keywords
telebot, telegram, bot, api, client, async, async-client, chat, nim, telegram-bot, telegram-bot-api, telegrambot
License
MIT
Install
nimble install telebot@#0.1.2

Documentation

telebot.nim

Async Telegram Bot API Client implement in @Nim-Lang

Installation

$ nimble install telebot

Usage

import asyncdispatch
import telebot

let bot = newTeleBot("ABC:XYZ")

proc main() {.async.} =
  let message =  await bot.sendMessage(XXXX, "hi boss")
  echo "Sent message ID: ", message.messageId

  var updates: seq[Update]
  while true:
    updates = await bot.getUpdates()
    echo "Got ", updates.len, " message(s)"

asyncCheck main()
runForever()

For more information please refer to official Telegram Bot API page