Skip to content

Client for Telegram Bot API written in Go

Notifications You must be signed in to change notification settings

trickstersio/telegram

Repository files navigation

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

About

Client for Telegram Bot API written in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages