msgService := chat.NewSpacesMessagesService(service)
msg := ChatCard("Title", "Subtitle", data)
// msg := "hello"
fmt.Print("Now ChatCard Method called\n")
_, err = msgService.Create("spaces/AAAAwlgqHZg", msg).Do()
if err != nil {
fmt.Println(err)
}
I'm going to connect to google chat But a google API error occurs, Any help would be appreciatable?
Short answer: You need to go to your GCP project's Chat API configuration page to fill out the Application info and then publish it.
Long answer: The error message
404: "No bot associated with this project."is mentioned in Google's issue tracker here. The explanation is that you need to first configure your "bot". The point is that the Chat API methods act through chatbots. These show up in the rooms with theBOTtag and the API works as if the bots are users performing the actions.Nowadays Google has changed their wording and they no longer refer to this as a "bot", now it's simply referred to as "app", but for all intents and purposes the process is the same. You need to go to the Chat API's configuration page in your GCP project to establish its name, avatar image, etc.
The app also needs to be published to the Google Workspace Marketplace either publicly or for your domain's users so they can interact with it. I recommend you check out their full documentation: