Skip to content

Instantly share code, notes, and snippets.

@buildingwatsize
Created July 20, 2020 09:21
Show Gist options
  • Save buildingwatsize/d74671b517e09c43abec83b43a1b92a1 to your computer and use it in GitHub Desktop.
Save buildingwatsize/d74671b517e09c43abec83b43a1b92a1 to your computer and use it in GitHub Desktop.
repository.go - Goldnoti [Phase 2]
var (
// Bot : For LINE Bot Client Configuration
Bot *linebot.Client
channelSecret string
channelToken string
)
// SetupLINEConfig : Setup Channel Secret and Channel Token for using in LINE Bot
func SetupLINEConfig() {
channelSecret = os.Getenv("CHANNEL_SECRET")
channelToken = os.Getenv("CHANNEL_TOKEN")
}
// LINEBotInitialize : First Initialize LINE Bot Integration
func LINEBotInitialize() {
var err error
Bot, err = linebot.New(
channelSecret,
channelToken,
)
if err != nil {
log.Panicln("LINE Bot Initialize Error:", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment