Skip to content

Commit

Permalink
#576 only comments starting with PM tag
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Oct 2, 2020
1 parent f0674c3 commit 107ffea
Showing 1 changed file with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,29 +396,31 @@ public void comment(final Event event) {
if(this.username.equalsIgnoreCase(comment.author())) {
return;
}
LOG.debug(
"Received comment [" + comment.body()
+ "] from @" + comment.author() + ". Starting conversation..."
);
final Conversation conversation = new IgnoreBots(
new Understand(
new Hello(
new Status(
new Resign(
new Deregister(
new Register(
new Confused()
if(comment.body().startsWith("@" + this.username)) {
LOG.debug(
"Received comment [" + comment.body()
+ "] from @" + comment.author() + ". Starting conversation..."
);
final Conversation conversation = new IgnoreBots(
new Understand(
new Hello(
new Status(
new Resign(
new Deregister(
new Register(
new Confused()
)
)
)
)
)
)
)
);
final Step steps = conversation.start(event);
LOG.debug("Executing steps...");
steps.perform(event);
LOG.debug("Conversation ended.");
);
final Step steps = conversation.start(event);
LOG.debug("Executing steps...");
steps.perform(event);
LOG.debug("Conversation ended.");
}
}

@Override
Expand Down

0 comments on commit 107ffea

Please sign in to comment.