mirror of
https://github.com/discordjs/discord.js.git
synced 2026-07-21 21:52:57 +00:00
feat(guild): Support message search (#11552)
feat(guild): message search Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,8 @@ import {
|
|||||||
type RESTGetAPIGuildMembersResult,
|
type RESTGetAPIGuildMembersResult,
|
||||||
type RESTGetAPIGuildMembersSearchQuery,
|
type RESTGetAPIGuildMembersSearchQuery,
|
||||||
type RESTGetAPIGuildMembersSearchResult,
|
type RESTGetAPIGuildMembersSearchResult,
|
||||||
|
type RESTGetAPIGuildMessagesSearchQuery,
|
||||||
|
type RESTGetAPIGuildMessagesSearchResult,
|
||||||
type RESTGetAPIGuildOnboardingResult,
|
type RESTGetAPIGuildOnboardingResult,
|
||||||
type RESTGetAPIGuildPreviewResult,
|
type RESTGetAPIGuildPreviewResult,
|
||||||
type RESTGetAPIGuildPruneCountQuery,
|
type RESTGetAPIGuildPruneCountQuery,
|
||||||
@@ -1201,6 +1203,26 @@ export class GuildsAPI {
|
|||||||
}) as Promise<RESTGetAPIGuildMembersSearchResult>;
|
}) as Promise<RESTGetAPIGuildMembersSearchResult>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Searches for messages.
|
||||||
|
*
|
||||||
|
* @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
|
||||||
|
* @param guildId - The id of the guild to search in
|
||||||
|
* @param query - The query to search for
|
||||||
|
* @param options - The options for searching for messages
|
||||||
|
*/
|
||||||
|
public async searchForMessages(
|
||||||
|
guildId: Snowflake,
|
||||||
|
query: RESTGetAPIGuildMessagesSearchQuery,
|
||||||
|
{ auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {},
|
||||||
|
) {
|
||||||
|
return this.rest.get(Routes.guildMessagesSearch(guildId), {
|
||||||
|
auth,
|
||||||
|
query: makeURLSearchParams(query),
|
||||||
|
signal,
|
||||||
|
}) as Promise<RESTGetAPIGuildMessagesSearchResult>;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits a guild member
|
* Edits a guild member
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user