Permalink
Browse files

formatting shit

  • Loading branch information...
nmonserrato committed Apr 1, 2018
1 parent 1002af3 commit 0d7cf701aafa208f139264066ba9c1660d776cc9
Showing with 7 additions and 11 deletions.
  1. +7 −11 src/main/java/org/mbarepoccu/bot/infrastructure/resources/MessageResource.java
@@ -78,15 +78,12 @@ private Reply handle(Message message) {
private void sleep()
{
if(withDelay)
{
if (withDelay) {
final long delay = RandomUtils.nextLong(500, 2000);
try
{
try {
Thread.sleep(delay);
}
catch (InterruptedException e)
{
catch (InterruptedException e) {
}
}
}
@@ -151,18 +148,17 @@ private Reply buildReplyForMessage(Message message)
private Reply buildReplyWithRandomImage(Message message)
{
final List<Reply> randomResponses = Arrays.asList(
final List<Reply> options = Arrays.asList(
aReply().in(message.chat).withSticker("CAADBQADuQEAAukKyAMFe9CCAAH2HHcC").build(),
aReply().in(message.chat).withSticker("CAADBAADgAIAAo-zWQNa5qKVuK6KiQI").build(),
aReply().in(message.chat).withGIF("CgADBAADE58AAsgeZAc8eTz0lPWp0gI").build()
);
return random(randomResponses);
return random(options);
}
private Reply buildReplyWithRandomText(Message message, String... options)
private Reply buildReplyWithRandomText(Message message, String... textuals)
{
final List<Reply> randomReplies = Stream.of(options).map(t -> aReply().in(message.chat).withText(t).build()).collect(toList());
return random(randomReplies);
return random(Stream.of(textuals).map(t -> aReply().in(message.chat).withText(t).build()).collect(toList()));
}
private Reply random(List<Reply> randomResponses)

0 comments on commit 0d7cf70

Please sign in to comment.