#[non_exhaustive]pub struct SearchGuildMessages {Show 24 fields
pub limit: Option<u8>,
pub offset: Option<u16>,
pub max_id: Option<MessageId>,
pub min_id: Option<MessageId>,
pub slop: Option<u8>,
pub content: Option<CompactString>,
pub channel_id: Vec<ChannelId>,
pub author_type: Vec<SearchFilter<SearchAuthorType>>,
pub author_id: Vec<UserId>,
pub mentions: Vec<UserId>,
pub mentions_role_id: Vec<RoleId>,
pub mention_everyone: Option<bool>,
pub replied_to_user_id: Vec<UserId>,
pub replied_to_message_id: Vec<MessageId>,
pub pinned: Option<bool>,
pub has: Vec<SearchFilter<SearchHasType>>,
pub embed_type: Vec<SearchEmbedType>,
pub embed_provider: Vec<CompactString>,
pub link_hostname: Vec<CompactString>,
pub attachment_filename: Vec<CompactString>,
pub attachment_extension: Vec<CompactString>,
pub sort_by: Option<SearchSortMode>,
pub sort_order: Option<SearchSortOrder>,
pub include_nsfw: Option<bool>,
}Expand description
The query of Search Guild Messages
(GET /guilds/{guild.id}/messages/search). Every filter is optional; list filters match
any of their values.
The endpoint needs READ_MESSAGE_HISTORY and depends on the MESSAGE_CONTENT privileged
intent. While the guild is not indexed yet, the request fails with
ErrorKind::NotYetIndexed of djs-rest (D-104).
discord.js counterpart: RESTGetAPIGuildMessagesSearchQuery (discord-api-types).
§Examples
use djs_model::rest::{SearchFilter, SearchGuildMessages, SearchHasType};
let mut query = SearchGuildMessages::default();
query.content = Some("release".into());
query.has = vec![SearchFilter::Include(SearchHasType::Link)];
query.author_type = vec![SearchFilter::Exclude(djs_model::rest::SearchAuthorType::Bot)];Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.limit: Option<u8>How many messages (1-25; Discord’s default is 25).
offset: Option<u16>How many results to skip (max 9975).
max_id: Option<MessageId>Messages before this message.
min_id: Option<MessageId>Messages after this message.
slop: Option<u8>How many words may lie between the matching words of content (max 100; default 2).
content: Option<CompactString>Text the messages contain (max 1024 characters).
channel_id: Vec<ChannelId>Messages in these channels (max 500).
Messages by these kinds of authors (or not, with SearchFilter::Exclude).
Messages by these users (max 100).
mentions: Vec<UserId>Messages mentioning these users (max 100).
mentions_role_id: Vec<RoleId>Messages mentioning these roles (max 100).
mention_everyone: Option<bool>Messages that do (or do not) mention @everyone.
replied_to_user_id: Vec<UserId>Messages replying to these users (max 100).
replied_to_message_id: Vec<MessageId>Messages replying to these messages (max 100).
pinned: Option<bool>Messages that are (or are not) pinned.
has: Vec<SearchFilter<SearchHasType>>Messages that have (or do not have) these things.
embed_type: Vec<SearchEmbedType>Messages with these kinds of embeds.
embed_provider: Vec<CompactString>Messages with embeds from these providers, case-sensitive (e.g. Tenor; max 100).
link_hostname: Vec<CompactString>Messages with links to these host names (e.g. discordapp.com; max 100).
attachment_filename: Vec<CompactString>Messages with attachments of these file names (max 100).
attachment_extension: Vec<CompactString>Messages with attachments of these extensions (e.g. txt; max 100).
sort_by: Option<SearchSortMode>How to sort (Discord’s default: by time).
sort_order: Option<SearchSortOrder>The direction (Discord’s default: descending); ignored when sorting by relevance.
include_nsfw: Option<bool>Whether to include age-restricted channels (Discord’s default: no).