💬Guild Messages

Prototypes from GuildMessageManager

Getting a message by ID

// discord.js
<GuildTextChannel>.messages.cache.get(string);

// djs-protofy
<GuildTextChannel>.messages.getById(string); // Message | undefined

Filtering messages by Author ID

// discord.js
<GuildTextChannel>.messages.cache.filter(message => message.author?.id === string);

// djs-protofy
<GuildTextChannel>.messages.filterByAuthorId(string); // Collection<string, Message>

Filtering messages by Content

// discord.js
<GuildTextChannel>.messages.cache.filter(message => message.content === string);

// djs-protofy
<GuildTextChannel>.messages.filterByContent(string | RegExp); // Collection<string, Message>

Filtering messages by Author's Bot

// discord.js
<GuildTextChannel>.messages.cache.filter(message => message.author?.bot);

// djs-protofy
<GuildTextChannel>.messages.filterByAuthorIsBots(); // Collection<string, Message>

Last updated