Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Got

Guide

Facebook Bots

Example

package main
import (
"fmt""log""net/http""os""github.com/ramin0/got"
)
funcmain() {
http.Handle("/messenger/", got.New(&got.BotData{
BaseURL: "https://mybot.com/messenger",
Page: &got.BotPage{
ID: "...",
AccessToken: "...",
VerifyToken: "...",
},
}, func(bot*got.BotData) {
bot.StartBlock(func(b*got.BotBlock) {
b.Component(&got.PluginFacebookProfile{})
b.Component(&got.ComponentText{
Text: "Hello, %{fb:first_name}!",
})
})
}).Handler())
port:=os.Getenv("PORT")
ifport=="" {
port="3000"
}
log.Printf("Listening on port %s...", port)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
}

About

Yet another bot-building framework

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages