Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dollabi11z/70bb04510cc36eb3499a8bfc3e09d941 to your computer and use it in GitHub Desktop.
Save dollabi11z/70bb04510cc36eb3499a8bfc3e09d941 to your computer and use it in GitHub Desktop.
Use some lightIRC javascript snippets for your own. Don't forgot to set true on loopClientCommands or loopServerCommands, depends what you use.
// #1 - Javascript snippet to let users join allowed channels only - See: http://redmine.lightirc.com/issues/647
function onClientCommand(command) {
var raw = command.split(' ');
var chanArray = ['#test', '#test1', '#test2'];
if (raw[0] == 'JOIN' && raw[1].charAt(0) == '#') {
if (chanArray.indexOf(raw[1]) < 0) {
alert('Sorry, this channel isn\'t allowed');
command = '';
}
}
return command;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment