Skip to content

Instantly share code, notes, and snippets.

@0x24a
Created January 29, 2024 14:52
Show Gist options
  • Save 0x24a/c84be71a2f5db9f02b464464dc4ecdaf to your computer and use it in GitHub Desktop.
Save 0x24a/c84be71a2f5db9f02b464464dc4ecdaf to your computer and use it in GitHub Desktop.
HC++ Plugin: No-Single-Punctuation-Mark
const punctuation_marks=Array.from(".,?!…,。?!")
function pmcheck(args){
if(args[0].cmd!="chat"){return args};
if((args[0].text.length == 1) || punctuation_marks.indexOf(args[0].text) != -1){
pushMessage({nick:"!",text:"Single punctuation mark cannot be sent."})
return false;
}else{
return args
}
}
hook.register("in","send",pmcheck)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment