K
Kord2y ago
tmpod

Forcibly getting messages from REST

Hello, I'm running a bot with the default entity supplying strategy (cacheWithRestFallback), but I want to fetch all messages from a channel from REST, to make sure I get everything and not just the ones sent in the bot's current lifetime. Here's what I'm thinking of doing:
EntitySupplyStrategy.rest.supply(kord).getMessagesAfter(Snowflake.min, id)
.collectIndexed { ... }
EntitySupplyStrategy.rest.supply(kord).getMessagesAfter(Snowflake.min, id)
.collectIndexed { ... }
Is there a better or more recommended way to do this? Thanks!
7 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
tmpod
tmpodOP2y ago
in this case, I don't want to cache the results just want to get the messages and be sure I'm getting the whole deal
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
tmpod
tmpodOP2y ago
kord.with(EntitySupplyStrategy.rest).getMessagesAfter(...)?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
tmpod
tmpodOP2y ago
is that preferable though?
LustigerLurch
LustigerLurch2y ago
you can do this:
channel.withStrategy(EntitySupplyStrategy.rest).getMessagesAfter(id)
channel.withStrategy(EntitySupplyStrategy.rest).getMessagesAfter(id)

Did you find this page helpful?