https://github.com/chyroc/go-telegram-download
Download Telegram File by MTProto(Support Big File).
https://github.com/chyroc/go-telegram-download
Last synced: 8 months ago
JSON representation
Download Telegram File by MTProto(Support Big File).
- Host: GitHub
- URL: https://github.com/chyroc/go-telegram-download
- Owner: chyroc
- License: apache-2.0
- Created: 2022-03-17T12:27:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-17T14:26:47.000Z (over 4 years ago)
- Last Synced: 2025-03-24T02:18:57.285Z (over 1 year ago)
- Language: Go
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-telegram-download
Download Telegram File by MTProto(Support Big File).
## Installation
```shell
go get github.com/chyroc/go-telegram-download
```
## Prerequisites
- how to get bot token:
- create bot: https://core.telegram.org/bots#creating-a-new-bot
- how to get app id and app hash:
- create app: https://core.telegram.org/api/obtaining_api_id
## Usage
```go
package main
import (
"context"
"fmt"
"github.com/chyroc/go-telegram-download"
"go.uber.org/zap"
)
func main() {
log, err := zap.NewDevelopment()
if err != nil {
panic(err)
}
defer func() { _ = log.Sync() }()
r := telegram_download.New(&telegram_download.Option{
AppID: 123,
AppHash: "xxx",
BotToken: "456:789",
SaveDir: "/Users/some/Downloads",
})
fmt.Println(r.Listen(context.Background()))
}
```