Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nasermirzaei89/telegram
Golang Telegram Bot API
https://github.com/nasermirzaei89/telegram
bot go golang lib library telegram telegram-api telegram-bot telegram-bot-api
Last synced: 3 months ago
JSON representation
Golang Telegram Bot API
- Host: GitHub
- URL: https://github.com/nasermirzaei89/telegram
- Owner: nasermirzaei89
- License: mit
- Created: 2017-03-15T10:09:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T14:38:10.000Z (almost 2 years ago)
- Last Synced: 2024-09-29T22:41:43.526Z (3 months ago)
- Topics: bot, go, golang, lib, library, telegram, telegram-api, telegram-bot, telegram-bot-api
- Language: Go
- Homepage:
- Size: 242 KB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Support: supported-currencies.go
Awesome Lists containing this project
README
# Telegram Bot API
[Telegram Bot API](https://core.telegram.org/bots/api) [Golang](https://golang.org) implementation
[![Build Status](https://travis-ci.org/nasermirzaei89/telegram.svg?branch=master)](https://travis-ci.org/nasermirzaei89/telegram)
[![Go Report Card](https://goreportcard.com/badge/github.com/nasermirzaei89/telegram)](https://goreportcard.com/report/github.com/nasermirzaei89/telegram)
[![GolangCI](https://golangci.com/badges/github.com/nasermirzaei89/telegram.svg)](https://golangci.com/r/github.com/nasermirzaei89/telegram)
[![Codecov](https://codecov.io/gh/nasermirzaei89/telegram/branch/master/graph/badge.svg)](https://codecov.io/gh/nasermirzaei89/telegram)
[![GoDoc](https://godoc.org/github.com/nasermirzaei89/telegram?status.svg)](https://godoc.org/github.com/nasermirzaei89/telegram)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://raw.githubusercontent.com/nasermirzaei89/telegram/master/LICENSE)## Status
Bot API 6.0 (https://core.telegram.org/bots/api-changelog#april-16-2022)
## Install
```sh
go get github.com/nasermirzaei89/telegram
```## Example
```go
package mainimport (
"context"
"github.com/nasermirzaei89/telegram"
"log"
"os"
)func main() {
bot := telegram.New(os.Getenv("TOKEN"))res, err := bot.GetUpdates(context.Background())
if err != nil {
log.Fatalln(err)
}if res.IsOK() {
log.Printf("%+v", res.GetUpdates())
} else {
log.Printf("%d: %s", res.GetErrorCode(), res.GetDescription())
}
}
```## License
MIT License
## Contributing
You can submit a [new issue](https://github.com/nasermirzaei89/telegram/issues/new) in GitHub [issues](https://github.com/nasermirzaei89/telegram/issues).
Or you can [create a fork](https://help.github.com/articles/fork-a-repo), hack on your fork and when you're done create a [pull request](https://help.github.com/articles/fork-a-repo#pull-requests), so that the code contribution can get merged into the main package.