Skip to content

Instantly share code, notes, and snippets.

@MaleXachi
Last active July 21, 2019 01:47
Show Gist options
  • Save MaleXachi/8e636accb56bf9ad582d to your computer and use it in GitHub Desktop.
Save MaleXachi/8e636accb56bf9ad582d 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