Originally Posted by
Jordan Belfort
Be careful with how many messages you have your bot send. Too many at a time (think of multiple players doing it at once) and your discord bot will lock out on too many requests. Been there lol. But very cool concept. Good luck with future creations.
At Ataraxia our bot sends messages from the server friends chat by our playerbase of about 50-100. Never had an issue like this. How'd you manage to get a problem? I think you'll be fine Dylan, but still interested in hearing. O.O
Perhaps it's because our bot uses JDA using .buildAsync() and we .queue() all messages we send. Probably a delay of a few milliseconds or so.
Originally Posted by
DylanPage95
so that will basically do the same thing that i put an example of?
He's telling you that for performance, nothing more.
Code:
StringBuilder messageBuilder = new StringBuilder("\n");
for (int i = 0; i <= 7; i++) {
Offer offer = GrandExchange.getOffer(World.getPlayer(player.getUsername()), i);
if (offer == null || offer.getAmount() - offer.getTotalAmmountSoFar() == 0) {
continue;
}
String suffix = "gp";
messageBuilder = messageBuilder.append(offer.isBuying() == true ? "Buying: " : "Selling: ").append("- ").append(offer.getName()).append(" x").append(amt).append(" for ").append(df2.format(tot / divisor)).append(suffix).append("(").append(df2.format(each / divisor)).append(suffix).append(" each)").append("\n");
}
String message = messageBuilder.toString();