Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.39 KB

README.md

File metadata and controls

53 lines (35 loc) · 1.39 KB

go-telegram

Test Status

go-telegram is a Go client library for accessing the Telegram API.

Installation

go-telegram is compatible with modern Go releases in module mode, with Go installed:

go get github.com/PB-Digital/go-telegram

will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

import "github.com/PB-Digital/go-telegram"

Usage

import "github.com/PB-Digital/go-telegram"

Construct a new Telegram client, then use the various services on the client to access different parts of the Telegram API.

For example:

client := telegram.NewClient("TELEGRAM_BOT_TOKEN")

// send plain message to Telegram channel or group
client.SendMessage(telegram.Message{
    ChatId:    "TELEGRAM_GROUP_OR_CHANNEL_ID",
    Body:      "Hello there!",
})

For more sample code snippets, head over to the example directory.

License

This library is licensed under the MIT License. See LICENSE for the full license text.