I spent a lot of time rewriting the output of fetchMessages(). Now, in addition to messages, it returns:
-
fetchedTimestamp, a timestamp that shows when the fetch was performed;
- you can select whether to return:
- the
guild where the channel is located;
- the
channel;
- the message authors, divided into:
-
authors (those who sent at least one normal message);
-
interactions (those who sent at least one message linked to an interaction);
-
webhooks.
For each message author, if you select the message id in the fields, an array containing all the messages they sent will be displayed.
I also added some functions to better handle large fetches:
-
get(id) for messages, even though it’s an array (this can be useful in certain cases);
- for both message authors and messages:
-
raw which returns the original array/map without the custom wrapper;
-
first(number?) and last(number?) functions, to return the first or last message(s).
In the next devlog I’ll finish updating index.d.ts and the README.md, then I’ll release v0.2.0 on npm.