Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 749 Bytes

README.md

File metadata and controls

45 lines (31 loc) · 749 Bytes

Telegram

This module wraps Telegram Bot API using only standard library without any external dependencies.

Usage

Add this module to the project:

go get github.com/trickstersio/telegram

Create client instance and start calling methods:

package main

import (
    "context"
    "github.com/trickstersio/telegram"
)

func main()  {
    client := telegram.NewClient()

    msg, err := client.SendMessage(context.Background(), SendMessageArgs{
        ChatID: 1,
        Text: "Hello, World!",
    })

    if err != nil {
        log.Fatal(err)
    }

    log.Println("Sent message", msg.ID)
}

Test

You can run tests using following command:

go test github.com/trickstersio/telegram