|
@ -65,14 +65,17 @@ func (t Tutorial) nextStep(cli *gomatrix.Client) { |
|
|
t.currentStep++ |
|
|
t.currentStep++ |
|
|
// Check that there is a valid mtutorial step to process
|
|
|
// Check that there is a valid mtutorial step to process
|
|
|
if t.currentStep < len(tutorialFlow.Tutorial.Steps) { |
|
|
if t.currentStep < len(tutorialFlow.Tutorial.Steps) { |
|
|
|
|
|
base := tutorialFlow.ResourcesBaseURL |
|
|
step := tutorialFlow.Tutorial.Steps[t.currentStep] |
|
|
step := tutorialFlow.Tutorial.Steps[t.currentStep] |
|
|
// Check message type
|
|
|
// Check message type
|
|
|
if step.Image != "" { |
|
|
if step.Image != "" { |
|
|
msg := gomatrix.ImageMessage{ |
|
|
msg := gomatrix.ImageMessage{ |
|
|
MsgType: "m.image", |
|
|
MsgType: "m.image", |
|
|
Body: "Hi I'm Riotbot", |
|
|
|
|
|
URL: step.Image, |
|
|
|
|
|
|
|
|
Body: "Hi I am Riotbot", |
|
|
|
|
|
URL: base + step.Image, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.Printf("Sending message %v", msg) |
|
|
if _, e := cli.SendMessageEvent(t.roomID, "m.room.message", msg); e != nil { |
|
|
if _, e := cli.SendMessageEvent(t.roomID, "m.room.message", msg); e != nil { |
|
|
log.Print("Failed to send image message") |
|
|
log.Print("Failed to send image message") |
|
|
} |
|
|
} |
|
|