GoTGProto is a helper package for gotd library, It aims to make td's raw functions easy-to-use with the help of features like using session strings, custom helper functions, storing peers and extracting chat or user ids through it etc.
We have an outstanding userbot project going on with GoTGProto, you can check it out by clicking here.
You can use this package to create bots and userbots with Telegram MTProto easily in golang, for any futher help you can check out the documentations or reach us through the following:
Note: This library is in the beta stage yet and may not be stable for every case.
You can download the library with the help of standard go get
command.
go get github.com/celestix/gotgproto
You can find various examples in the examples' directory, one of them i.e. authorizing as a user is as follows:
package main
import (
"log"
"github.com/celestix/gotgproto"
"github.com/celestix/gotgproto/sessionMaker"
"github.com/glebarez/sqlite"
)
func main() {
client, err := gotgproto.NewClient(
// Get AppID from https://my.telegram.org/apps
123456,
// Get ApiHash from https://my.telegram.org/apps
"API_HASH_HERE",
// ClientType, as we defined above
gotgproto.ClientTypePhone("PHONE_NUMBER_HERE"),
// Optional parameters of client
&gotgproto.ClientOpts{
Session: sessionMaker.SqlSession(sqlite.Open("echobot")),
},
)
if err != nil {
log.Fatalln("failed to start client:", err)
}
client.Idle()
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the examples as appropriate.
Licensed Under GNU General Public License v3