docs: Fixed some missing docstrings or incorrect return types (#2093)

* Fix some missing doc strings
Mainly just readonly tags

* Return an error when guild#allowDMs is ran from a bot account, and fix some return types

* WebhookClient implements Webhook, doesn't extend it

* Fix Client#rateLimit docs not showing what it returns

Cause I wanted to handle this event only to see no return props 🤔

* Actually make Client#rateLimit show the right info

Its an object with all the info
This commit is contained in:
Frangu Vlad
2017-11-17 15:20:57 +02:00
committed by Crawl
parent 6fa4fc532c
commit 0cd4a92fb8
8 changed files with 21 additions and 11 deletions

View File

@@ -321,7 +321,7 @@ class Guild extends Base {
/**
* System channel for this guild
* @type {?GuildChannel}
* @type {?TextChannel}
* @readonly
*/
get systemChannel() {
@@ -806,6 +806,7 @@ class Guild extends Base {
* @returns {Promise<Guild>}
*/
allowDMs(allow) {
if (this.client.user.bot) return Promise.reject(new Error('FEATURE_USER_ONLY'));
const settings = this.client.user.settings;
if (allow) return settings.removeRestrictedGuild(this);
else return settings.addRestrictedGuild(this);
@@ -818,7 +819,7 @@ class Guild extends Base {
* string, the ban reason. Supplying an object allows you to do both.
* @param {number} [options.days=0] Number of days of messages to delete
* @param {string} [options.reason] Reason for banning
* @returns {Promise<GuildMember|User|string>} Result object will be resolved as specifically as possible.
* @returns {Promise<GuildMember|User|Snowflake>} Result object will be resolved as specifically as possible.
* If the GuildMember cannot be resolved, the User will instead be attempted to be resolved. If that also cannot
* be resolved, the user ID will be the result.
* @example