1
bot/examples/getme/main.go
mbehboodian 7521fc90f0
Improve inline_keyboard example app (#31)
* improve inline_keyboard example app

Signed-off-by: mbehboodian <29199390+xeptore@users.noreply.github.com>

* add examples bot instantiation error handling

Signed-off-by: mbehboodian <29199390+xeptore@users.noreply.github.com>

---------

Signed-off-by: mbehboodian <29199390+xeptore@users.noreply.github.com>
2023-04-26 12:00:17 +03:00

23 lines
364 B
Go

package main
import (
"context"
"fmt"
"os"
"github.com/go-telegram/bot"
)
func main() {
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)
}
user, _ := b.GetMe(context.Background())
fmt.Printf("User: %#v\n", user)
}