diff options
| author | David Phillips <david@sighup.nz> | 2017-03-09 11:27:03 +1300 | 
|---|---|---|
| committer | David Phillips <david@sighup.nz> | 2017-03-09 11:27:03 +1300 | 
| commit | 926886e054edd1dd67e3195416c1c183f3850946 (patch) | |
| tree | 1ef1e3aca17f01cdd01fa029766e12fbe3060191 | |
| parent | 51a140854c757f81cc7bc9b90a0175e185ec0e0e (diff) | |
| download | idalius-926886e054edd1dd67e3195416c1c183f3850946.tar.xz | |
Add message/reason to part command
| -rwxr-xr-x | saxrobot | 12 | 
1 files changed, 9 insertions, 3 deletions
| @@ -102,11 +102,17 @@ sub irc_msg {  		}  	}  	if ($what =~ /^part\s/) { -		my ($channel) = $what =~ /^part\s+(\S+)$/; +		my $message; +		my ($channel, $message) = $what =~ /^part\s+(\S+)(\s(.*))?$/;  		if ($channel) { -			$irc->yield(part => $channel); +			if (!$message) { +				$message = "commanded by $nick"; +			} else { +				$message =~ s/^\s+//; +			} +			$irc->yield(part => $channel => $message);  		} else { -			$irc->yield(privmsg => $nick => "Syntax: part <channel>"); +			$irc->yield(privmsg => $nick => "Syntax: part [partmsg]");  		}  	}  	if ($what =~ /^join\s/) { | 
