Merge branch 'indev' into indev-prism

This commit is contained in:
Amish Shah
2016-12-29 17:26:22 +00:00
10 changed files with 48 additions and 30 deletions

View File

@@ -47,9 +47,9 @@ class RESTMethods {
if (typeof content !== 'undefined') content = this.client.resolver.resolveString(content);
if (content) {
if (typeof code === 'string') {
if (typeof code !== 'undefined' && (typeof code !== 'boolean' || code === true)) {
content = escapeMarkdown(this.client.resolver.resolveString(content), true);
content = `\`\`\`${typeof code !== 'undefined' && code !== null ? code : ''}\n${content}\n\`\`\``;
content = `\`\`\`${typeof code !== 'boolean' ? code || '' : ''}\n${content}\n\`\`\``;
}
if (disableEveryone || (typeof disableEveryone === 'undefined' && this.client.options.disableEveryone)) {
@@ -59,7 +59,7 @@ class RESTMethods {
if (split) content = splitMessage(content, typeof split === 'object' ? split : {});
}
const send = (chan) => {
const send = chan => {
if (content instanceof Array) {
const messages = [];
(function sendChunk(list, index) {
@@ -87,9 +87,9 @@ class RESTMethods {
updateMessage(message, content, { embed, code } = {}) {
content = this.client.resolver.resolveString(content);
if (code) {
if (typeof code !== 'undefined' && (typeof code !== 'boolean' || code === true)) {
content = escapeMarkdown(this.client.resolver.resolveString(content), true);
content = `\`\`\`${typeof code !== 'undefined' && code !== null ? code : ''}\n${content}\n\`\`\``;
content = `\`\`\`${typeof code !== 'boolean' ? code || '' : ''}\n${content}\n\`\`\``;
}
return this.rest.makeRequest('patch', Constants.Endpoints.channelMessage(message.channel.id, message.id), true, {
content, embed,