Last active
July 21, 2019 01:47
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #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