Skip to content

Commit

Permalink
Add /WHISPER command
Browse files Browse the repository at this point in the history
Whisper

This script adds a `/WHISPER` command, allowing you to whisper to someone in a channel.

The server MUST support `draft/channel-context` in order for this to work.

The channel MUST be the active window when using `/WHISPER`
  • Loading branch information
ValwareIRC authored Jul 15, 2022
1 parent de0bacc commit 4664804
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions whisper/whisper.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
; Licence: GPLv3 or later
; Copyright Ⓒ 2022 Valerie Pond
; This is just a small script which lets you use /WHISPER <nick> <message>
; It sends a message to the specified nick using the channel as a context
; allowing you to essentially whisper to someone in the channel.
;
; The server MUST support `draft/channel-context` in order for this to work.
; The channel MUST be the active window when using /WHISPER

alias whisper {
%nick = $1
%msg = $2-
%chan = $active
if (%chan !ischan) {
echo -at You are not on a channel
return
}
if ($left(%nick,1) == $chr(35)) {
echo -at * You cannot whisper to a channel
return
}
if (%nick !ison %chan) || ($me !ison %chan) {
echo -at * You do not share that channel
return
}
.raw @+draft/channel-context= $+ %chan NOTICE %nick : $+ %msg
echo -t %chan [Whisper to %nick $+ ] %msg
}

on *:NOTICE:*:?:{
if ($msgtags(+draft/channel-context).key !== $null) echo -t $msgtags(+draft/channel-context).key [Whisper from $nick $+ ] $1-
}

0 comments on commit 4664804

Please sign in to comment.