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

@@ -727,6 +727,10 @@ var InternalClient = (function () {
return this.resolver.resolveChannel(where).then(function (destination) {
var content = _this15.resolver.resolveString(_content);
if (_this15.client.options.disableEveryone || options.disableEveryone) {
content = content.replace(/(@)(everyone|here)/g, "$1$2");
}
if (options.file) {
return _this15.resolver.resolveFile(options.file.file).then(function (file) {
return _this15.apiRequest("post", _Constants.Endpoints.CHANNEL_MESSAGES(destination.id), true, {
@@ -770,6 +774,9 @@ var InternalClient = (function () {
content = {
content: this.resolver.resolveString(content)
};
if (this.client.options.disableEveryone) {
content.content = content.content.replace(/(@)(everyone|here)/g, "$1$2");
}
}
return this.resolver.resolveChannel(where).then(function (channel) {