mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
committed by
Schuyler Cebulskie
parent
f0adf8f122
commit
beffb390e6
@@ -3,6 +3,7 @@ const Role = require('./Role');
|
||||
const Emoji = require('./Emoji');
|
||||
const Presence = require('./Presence').Presence;
|
||||
const GuildMember = require('./GuildMember');
|
||||
const MessageSearch = require('./MessageSearch');
|
||||
const Constants = require('../util/Constants');
|
||||
const Collection = require('../util/Collection');
|
||||
const cloneObject = require('../util/CloneObject');
|
||||
@@ -703,6 +704,25 @@ class Guild {
|
||||
return this.client.rest.methods.setRolePositions(this.id, updatedRoles);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a search
|
||||
* @param {MessageSearchOptions} [options={}] Options to pass to the search
|
||||
* @returns {MessageSearch}
|
||||
* @example
|
||||
* guild.search()
|
||||
* .content('discord.js')
|
||||
* .before('2016-11-17')
|
||||
* .execute()
|
||||
* .then(res => {
|
||||
* const hit = res[0].find(m => m.hit).content;
|
||||
* console.log(`I found: **${hit}**`);
|
||||
* })
|
||||
* .catch(console.error);
|
||||
*/
|
||||
search(options) {
|
||||
return new MessageSearch(this, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this Guild equals another Guild. It compares all properties, so for most operations
|
||||
* it is advisable to just compare `guild.id === guild2.id` as it is much faster and is often
|
||||
|
||||
Reference in New Issue
Block a user