docs: improvements & examples

This commit is contained in:
Lewdcario
2018-03-01 20:47:18 -06:00
parent acdf43a872
commit fcdffcf623
3 changed files with 16 additions and 2 deletions

View File

@@ -441,10 +441,14 @@ class Guild {
/**
* Fetch a collection of banned users in this guild.
* @returns {Promise<Collection<Snowflake, User>>}
* @example
* // Fetch bans in guild
* guild.fetchBans()
* .then(bans => console.log(`This guild has ${bans.size} bans`))
* .catch(console.error);
*/
fetchBans() {
return this.client.rest.methods.getGuildBans(this)
// This entire re-mapping can be removed in the next major release
.then(bans => {
const users = new Collection();
for (const ban of bans.values()) users.set(ban.user.id, ban.user);