add config
This commit is contained in:
@ -17,10 +17,8 @@ import (
|
||||
|
||||
|
||||
// Чатбот
|
||||
func JiraBot() {
|
||||
func JiraBot(cfg *config.Config) {
|
||||
|
||||
|
||||
cfg, _ := config.GetConfig()
|
||||
redis := utils.Redis(cfg.Redis)
|
||||
ctx := context.Background()
|
||||
pnsq := utils.GetProducer()
|
||||
@ -47,10 +45,9 @@ func JiraBot() {
|
||||
b.Handle("/exit", scenes.Exit(b, redis, ctx))
|
||||
|
||||
b.Handle("/hello", func(m *telegram.Message) {
|
||||
b.Send(m.Sender, "Hello World!")
|
||||
b.Send(m.Sender, "Hello World from chatbot")
|
||||
messageBody := []byte("hello")
|
||||
topicName := "error"
|
||||
|
||||
topicName := "jira"
|
||||
// Synchronously publish a single message to the specified topic.
|
||||
// Messages can also be sent asynchronously and/or in batches.
|
||||
err = pnsq.Publish(topicName, messageBody)
|
||||
@ -58,7 +55,6 @@ func JiraBot() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
})
|
||||
|
||||
fmt.Println(templates.Title(b.Me, cfg.BotVersion, jiraClient.GetBaseURL().Host))
|
||||
b.Start()
|
||||
}
|
||||
|
Reference in New Issue
Block a user