org.finos.springbot.example.rooms.BroadcastController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rooms-bot Show documentation
Show all versions of rooms-bot Show documentation
Allows you to send a message to any room the bot is in
package org.finos.springbot.example.rooms;
import org.finos.springbot.workflow.annotations.ChatButton;
import org.finos.springbot.workflow.annotations.ChatRequest;
import org.finos.springbot.workflow.annotations.ChatResponseBody;
import org.finos.springbot.workflow.annotations.WorkMode;
import org.finos.springbot.workflow.content.Message;
import org.finos.springbot.workflow.response.MessageResponse;
import org.springframework.stereotype.Controller;
@Controller
public class BroadcastController {
@ChatRequest(value = "broadcast")
@ChatResponseBody(workMode = WorkMode.EDIT)
public Broadcast createForm() {
return new Broadcast();
}
@ChatButton(value = Broadcast.class, buttonText = "Broadcast", showWhen = WorkMode.EDIT)
public MessageResponse broadcast(Broadcast br) {
Message out = Message.of(br.send);
return new MessageResponse(br.to, out);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy