Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syfaro/finch
A Golang Telegram Bot framework
https://github.com/syfaro/finch
bot golang telegram-bot telegram-bot-api
Last synced: about 1 month ago
JSON representation
A Golang Telegram Bot framework
- Host: GitHub
- URL: https://github.com/syfaro/finch
- Owner: Syfaro
- Created: 2015-11-20T16:28:08.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-08T19:40:31.000Z (about 3 years ago)
- Last Synced: 2024-06-20T15:02:31.081Z (5 months ago)
- Topics: bot, golang, telegram-bot, telegram-bot-api
- Language: Go
- Size: 41 KB
- Stars: 23
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# finch
A Golang Telegram Bot framework
Unlike the [Telegram Bot API](https://github.com/go-telegram-bot-api/telegram-bot-api), this is a framework for writing commands, not just low level dealings with the API directly.
You can see how to write some commands from the example commands provided in the `commands` folder.
## Example
It's fairly easy to get this bot running, it requires few lines of code.
```go
package mainimport (
"github.com/Syfaro/finch"
_ "github.com/Syfaro/finch/commands/help"
_ "github.com/Syfaro/finch/commands/info"
_ "github.com/Syfaro/finch/commands/stats"
)func main() {
f := finch.NewFinch("MyAwesomeBotToken")f.Start()
}
```The webhook listener code is currently untested, and requires running a `net/http` server.
```go
package mainimport (
"github.com/Syfaro/finch"
_ "github.com/Syfaro/finch/commands/help"
_ "github.com/Syfaro/finch/commands/info"
_ "github.com/Syfaro/finch/commands/stats"
"net/http"
)func main() {
f := finch.NewFinchWithClient("MyAwesomeBotToken", &http.Client{})f.StartWebhook("/" + f.API.Token)
http.ListenAndServeTLS("0.0.0.0:8443", "cert.pem", "key.pem", nil)
}
```A full bot example may be found at [selectionsbot](https://github.com/Syfaro/selectionsbot).