Remove all string object references (#586)

This commit is contained in:
Schuyler Cebulskie
2016-09-03 11:58:28 -04:00
committed by Amish Shah
parent ec0a5cdfbc
commit d97ce2e181
10 changed files with 19 additions and 23 deletions

View File

@@ -31,7 +31,7 @@ class DMChannel extends Channel {
}
/**
* When concatenated with a String, this automatically concatenates the recipient's mention instead of the
* When concatenated with a string, this automatically concatenates the recipient's mention instead of the
* DM channel object.
* @returns {string}
*/

View File

@@ -68,7 +68,7 @@ class Emoji {
}
/**
* When concatenated with a String, this automatically returns the emoji mention rather than the object.
* When concatenated with a string, this automatically returns the emoji mention rather than the object.
* @returns {string}
* @example
* // send an emoji:

View File

@@ -39,7 +39,7 @@ class EvaluatedPermissions {
* @returns {boolean}
*/
hasPermission(permission, explicit = false) {
if (permission instanceof String || typeof permission === 'string') {
if (typeof permission === 'string') {
permission = Constants.PermissionFlags[permission];
}

View File

@@ -151,7 +151,7 @@ class Guild {
}
/**
* When concatenated with a String, this automatically concatenates the Guild's name instead of the Guild object.
* When concatenated with a string, this automatically concatenates the Guild's name instead of the Guild object.
* @returns {string}
* @example
* // logs: Hello from My Guild!

View File

@@ -263,7 +263,7 @@ class GuildChannel extends Channel {
}
/**
* When concatenated with a String, this automatically returns the Channel's mention instead of the Channel object.
* When concatenated with a string, this automatically returns the Channel's mention instead of the Channel object.
* @returns {string}
* @example
* // Outputs: Hello from #general

View File

@@ -198,7 +198,7 @@ class Role {
* }
*/
hasPermission(permission, explicit = false) {
if (permission instanceof String || typeof permission === 'string') {
if (typeof permission === 'string') {
permission = Constants.PermissionFlags[permission];
}
@@ -216,7 +216,7 @@ class Role {
}
/**
* When concatenated with a String, this automatically concatenates the Role mention rather than the Role object.
* When concatenated with a string, this automatically concatenates the Role mention rather than the Role object.
* @returns {string}
*/
toString() {

View File

@@ -56,7 +56,7 @@ class User {
}
/**
* When concatenated with a String, this automatically concatenates the User's mention instead of the User object.
* When concatenated with a string, this automatically concatenates the User's mention instead of the User object.
* @returns {string}
* @example
* // logs: Hello from <@123456789>!

View File

@@ -196,7 +196,7 @@ class TextBasedChannel {
*/
sendFile(attachment, fileName) {
if (!fileName) {
if (attachment instanceof String || typeof attachment === 'string') {
if (typeof attachment === 'string') {
fileName = path.basename(attachment);
} else if (attachment && attachment.path) {
fileName = path.basename(attachment.path);