Skip to content

Commit

Permalink
Add /hidealts command
Browse files Browse the repository at this point in the history
When a user is spamming, often times they are doing so under several accounts.  When this happens, a staff member has to manually hide each alts messages in the room, which takes up one line of the chat for each alt.  By doing this, it automatically does it on the same line as the lock  message at the same time, which both clutters up the chat less and makes it easier on the staff.
  • Loading branch information
panpawn committed Jul 10, 2017
1 parent c553004 commit 844a172
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions chat-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,8 @@ exports.commands = {
},
unnamelockhelp: ["/unnamelock [username] - Unnamelocks the user. Requires: % @ * & ~"],

hidetext: function (target, room, user) {
hidealts: 'hidetext',
hidetext: function (target, room, user, connection, cmd) {
if (!target) return this.parse('/help hidetext');

this.splitTarget(target);
Expand All @@ -2203,11 +2204,22 @@ exports.commands = {
return this.errorReply("User '" + name + "' is not banned from this room or locked.");
}

this.addModCommand("" + targetUser.name + "'s messages were cleared from " + room.title + " by " + user.name + ".");
this.add('|unlink|' + hidetype + userid);
if (userid !== toId(this.inputUsername)) this.add('|unlink|' + hidetype + toId(this.inputUsername));
if (cmd === 'hidealts') {
this.addModCommand(`${targetUser.name}'s alternate account's messages were cleared from ${room.title} by ${user.name}.`);
this.add(`|unlink|${hidetype}${userid}`);
for (let i in targetUser.prevNames) {
this.add(`|unlink|${hidetype}${targetUser.prevNames[i]}`);
}
} else {
this.addModCommand("" + targetUser.name + "'s messages were cleared from " + room.title + " by " + user.name + ".");
this.add('|unlink|' + hidetype + userid);
if (userid !== toId(this.inputUsername)) this.add('|unlink|' + hidetype + toId(this.inputUsername));
}
},
hidetexthelp: ["/hidetext [username] - Removes a locked or banned user's messages from chat (includes users banned from the room). Requires: % (global only), @ * # & ~"],
hidetexthelp: [
"/hidetext [username] - Removes a locked or banned user's messages from chat (includes users banned from the room). Requires: % (global only), @ * # & ~",
"/hidealts [username] - Removes a locked or banned user's messages, and their alternate account's messages from the chat (includes users banned from the room). Requires: % (global only), @ * # & ~",
],

ab: 'blacklist',
blacklist: function (target, room, user) {
Expand Down

0 comments on commit 844a172

Please sign in to comment.