var fs = require('fs');
exports.commands = {
 
 dm: 'daymute',
	daymute: function (target, room, user) {
		if (!target) return this.parse('/help daymute');
		if (!this.can('mute', targetUser, room)) return false;
                if (room.isMuted(user) && !user.can('bypassall')) return this.errorReply("You cannot do this while unable to talk.");
		
		target = this.splitTarget(target);
		var targetUser = this.targetUser;
		if (!targetUser) return this.sendReply('User "' + this.targetUsername + '" not found.');

		if (((targetUser.mutedRooms[room.id] && (targetUser.muteDuration[room.id] || 0) >= 50 * 60 * 1000) || targetUser.locked) && !target) {
			var problem = ' but was already ' + (!targetUser.connected ? 'offline' : targetUser.locked ? 'locked' : 'muted');
			return this.privateModCommand('(' + targetUser.name + ' would be muted by ' + user.name + problem + '.)');
		}

		targetUser.popup(user.name + ' has muted you for 24 hours. ' + target);
		this.addModCommand('' + targetUser.name + ' was muted by ' + user.name + ' for 24 hours.' + (target ? " (" + target + ")" : ""));
		var alts = targetUser.getAlts();
		if (alts.length) this.addModCommand("" + targetUser.name + "'s alts were also muted: " + alts.join(", "));

		targetUser.mute(room.id, 24 * 60 * 60 * 1000, true);
	},

};

@@ -519,100 +519,54 @@
 f ((
-(targetUser.mutedRooms%5Broom.id%5D && (targetUser.muteDuration%5Broom.id%5D %7C%7C 0) %3E= 50 * 60 * 1000
+room.isMuted(targetUser) && !canBeMutedFurther
 ) %7C%7C
@@ -587,20 +587,19 @@
 cked
-) &&
+ %7C%7C
  !target
 ) %7B%0A
@@ -594,16 +594,30 @@
  !target
+User.connected
 ) %7B%0A%09%09%09v
@@ -629,17 +629,17 @@
 oblem = 
-'
+%22
  but was
@@ -647,17 +647,17 @@
 already 
-'
+%22
  + (!tar
@@ -680,17 +680,17 @@
 d ? 
-'
+%22
 offline
-'
+%22
  : t
@@ -712,29 +712,49 @@
 d ? 
-'
+%22
 locked
-' : 'muted'
+%22 : %22licked%22
 );%0A
+%09%09%09if (!target) %7B%0A%09
 %09%09%09r
@@ -786,11 +786,11 @@
 and(
-'('
+%22(%22
  + t
@@ -806,17 +806,17 @@
 .name + 
-'
+%22
  would b
@@ -818,33 +818,33 @@
 uld be muted by 
-'
+%22
  + user.name + p
@@ -856,12 +856,159 @@
 m + 
-'.)'
+%22.)%22);%0A%09%09%09%7D%0A%09%09%09return this.addModCommand(%22%22 + targetUser.name + %22 would be muted by %22 + user.name + problem + %22.%22 + (target ? %22 (%22 + target + %22)%22 : %22%22)
 );%0A%09

Update daymute.js