mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
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:
@@ -79,6 +79,7 @@ var Client = (function (_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];
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user