Skip to content

Commit

Permalink
Create display-name.mrc
Browse files Browse the repository at this point in the history
  • Loading branch information
ValwareIRC authored Aug 23, 2022
1 parent bdc1b29 commit b7583c6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions display-name/display-name.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is a script which allows you to see and send the IRCv3 proposed `display-name` message-tag
# You can set your display name by typing /displayname WeeWoo
# Must be connected to a server which supports message-tags, or if unrealircd, you'll need to load my module:
# https://github.com/ValwareIRC/valware-unrealircd-mods/tree/main/display-name

on ^*:TEXT:*:*:{
%display = $msgtags(+draft/display-name).key
if (!%display) return
echo -tc normal $chan < $+ %display ( $+ $nick $+ ) $+ > $1-
window -g1 $target
halt
}


on ^*:ACTION:*:*:{
%display = $msgtags(+draft/display-name).key
%rep = \s
%repl = $chr(32)
%display = $replace(%display,%rep,%repl)
if (!%display) return
echo -tc action $target * %display ( $+ $nick $+ ) $1-
window -g1 $target
halt
}

on *:PARSELINE:out:*:{
tokenize 32 $parseline
if (%displayname == $null) return
if ($left($1,1) == @) && (display-name !isin $1) {
.parseline -ot $1 $+ ;+draft/display-name= $+ %displayname $2-
}
}

on *:LOAD:set %displayname $$?="What display name would you like?"
alias displayname set %displayname $1-

0 comments on commit b7583c6

Please sign in to comment.