Add disableEveryone option (#400)

* Added support for new game objects

bot.setStreaming(name, url, type, callback); added
logic for Internal setStatus updated to check if string or object

* Add disableEveryone option

* forgot to compile

oh well, it can be squash merged
This commit is contained in:
Brussell
2016-06-01 23:35:32 -05:00
committed by abal
parent c88feaa554
commit 636a095377
5 changed files with 22 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ export default class Client extends EventEmitter {
this.options.guildCreateTimeout = options.guildCreateTimeout || 1000;
this.options.shardId = options.shardId || 0;
this.options.shardCount = options.shardCount || 0;
this.options.disableEveryone = options.disableEveryone || false;
if (typeof options.shardCount === "number" && typeof options.shardId === "number" && options.shardCount > 0) {
this.options.shard = [options.shardId, options.shardCount];

View File

@@ -616,6 +616,10 @@ export default class InternalClient {
.then(destination => {
var content = this.resolver.resolveString(_content);
if (this.client.options.disableEveryone || options.disableEveryone) {
content = content.replace(/(@)(everyone|here)/g, '$1\u200b$2');
}
if (options.file) {
return this.resolver.resolveFile(options.file.file)
.then(file =>
@@ -655,6 +659,9 @@ export default class InternalClient {
content = {
content: this.resolver.resolveString(content)
};
if (this.client.options.disableEveryone) {
content.content = content.content.replace(/(@)(everyone|here)/g, '$1\u200b$2');
}
}
return this.resolver.resolveChannel(where)