Skip to content

Commit

Permalink
Forbid multiple actions from a single state
Browse files Browse the repository at this point in the history
  • Loading branch information
nikvoloshin committed Mar 2, 2021
1 parent e5a009b commit 654bfd0
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class StateBuilder<B : BotRequest, R : Reactions> internal constructor(
* @param body a code block of the action
*/
fun action(body: @ScenarioDsl ActionContext<ActivatorContext, B, R>.() -> Unit) {
check(action == null) { "Multiple actions are not available in a single state: ${path}" }
action = { channelToken.invoke(body) }
}

Expand Down

0 comments on commit 654bfd0

Please sign in to comment.