
* 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>
23 lines
364 B
Go
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)
|
|
}
|