telebot

Async Telegram Bot API Client


Keywords
telebot, telegram, bot, api, client, async, chat, nim
License
MIT
Install
nimble install telebot

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