2022-04-26 00:02:51 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/go-telegram/bot"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-04-26 17:00:17 +08:00
|
|
|
b, err := bot.New(os.Getenv("EXAMPLE_TELEGRAM_BOT_TOKEN"))
|
|
|
|
if nil != err {
|
|
|
|
// panics for the sake of simplicity.
|
|
|
|
// you should handle this error properly in your code.
|
|
|
|
panic(err)
|
|
|
|
}
|
2022-04-26 00:02:51 +08:00
|
|
|
|
2022-05-06 17:47:43 +08:00
|
|
|
user, _ := b.GetMe(context.Background())
|
2022-04-26 00:02:51 +08:00
|
|
|
|
|
|
|
fmt.Printf("User: %#v\n", user)
|
|
|
|
}
|