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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T14:38:10.000Z (over 2 years ago)
- Last Synced: 2025-03-24T02:06:33.337Z (4 months ago)
- Topics: bot, go, golang, lib, library, telegram, telegram-api, telegram-bot, telegram-bot-api
- Language: Go
- Homepage:
- Size: 242 KB
- Stars: 15
- Watchers: 2
- 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
[](https://travis-ci.org/nasermirzaei89/telegram)
[](https://goreportcard.com/report/github.com/nasermirzaei89/telegram)
[](https://golangci.com/r/github.com/nasermirzaei89/telegram)
[](https://codecov.io/gh/nasermirzaei89/telegram)
[](https://godoc.org/github.com/nasermirzaei89/telegram)
[](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.