code: private static List<JsonNode> requestAsJsonNodes(TextChannel channel, int limit, long before, long after) {
          RestRequest<List<JsonNode>> restRequest =
                  new RestRequest<List<JsonNode>>(channel.getApi(), RestMethod.GET, RestEndpoint.MESSAGE)
                  .setUrlParameters(channel.getIdAsString());
  
          if (limit != -1) {
              restRequest.addQueryParameter("limit", String.valueOf(limit));
          }
          if (before != -1) {
              restRequest.addQueryParameter("before", Long.toUnsignedString(before));
          }
          if (after != -1) {
              restRequest.addQueryParameter("after", Long.toUnsignedString(after));
          }
  
          return restRequest.execute(result -> {
              List<JsonNode> messageJsonNodes = new ArrayList<>();
              result.getJsonBody().iterator().forEachRemaining(messageJsonNodes::add);
              return messageJsonNodes;
          }).join();
      }
docs: Requests the messages from Discord.
  
  @param channel The channel of which to get messages from.
  @param limit The limit of messages to get.
  @param before Get messages before the message with this id.
  @param after Get messages after the message with this id.
  @return The JSON nodes.