Skip to content

Instantly share code, notes, and snippets.

@AndrioCelos
Last active March 12, 2018 13:50
Show Gist options
  • Save AndrioCelos/59d00bef88b05ae838c2bba7e3b36a33 to your computer and use it in GitHub Desktop.
Save AndrioCelos/59d00bef88b05ae838c2bba7e3b36a33 to your computer and use it in GitHub Desktop.
if(!$0)
{
echo $tr("Usage:","defscript")
echo " /mute <nick_list>"
halt;
}
if(!$channel)
{
echo "[Mute]: "$tr("This is not a channel window","defscript")
halt;
}
foreach(%nick,$str.split(",",$0))
{
if(%nick)
{
#if we don't know the user ident/host (yet), we can only ban his nick
if($isWellKnown(%nick))
%mask = ~q:$mask(%nick,$option(uintDefaultBanType));
else
%mask = ~q:%nick!*@*;
if($chan.isOp(%nick))
%raw = "mode $target -o+b %nick %mask"
else
%raw = "mode $target +b %mask"
raw -q %raw
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment