Added setup script for inspIRCd

Added bot script for registering and unregistering permanent channels
TODO: inspircd config template
This commit is contained in:
knotteye
2019-09-18 16:46:25 -05:00
parent dd0ab1e465
commit 4309da7c39
7 changed files with 132 additions and 39 deletions

33
src/chanbot.ts Normal file
View File

@@ -0,0 +1,33 @@
import irc = require('irc');
function chanReg(channel: string, owner: string){
var bot = new irc.Client('127.0.0.1', 'ChanReg', {
channels: ['#ChanReg'],
userName: 'ChanReg',
realName: 'Channel Registration Bot',
floodProtection: false,
});
bot.addListener('registered', (message) => {
bot.send('OPER', 'admin', 'test');
bot.join(channel);
bot.send('MODE', channel, '+P');
bot.send('MODE', channel, '+w', 'o:'+owner+'!*@*');
bot.disconnect();
});
}
function chanUnReg(channel: string){
var bot = new irc.Client('127.0.0.1', 'ChanReg', {
channels: [''],
userName: 'ChanReg',
realName: 'Channel Registration Bot',
floodProtection: false,
debug: true
});
bot.addListener('registered', (message) => {
bot.send('OPER', 'admin', 'test');
bot.join(channel);
bot.send('MODE', channel, '-P');
bot.disconnect();
});
}

View File

@@ -1,7 +1,6 @@
import NodeMediaServer = require("node-media-server");
import fs = require ("fs");
import NodeMediaServer = require('node-media-server');
import fs = require('fs');
const { exec } = require('child_process');
const ircd = require("./lib/IRCDjs-six/lib/server.js").Server;
//initialize configs, eventually grab from runtime config file
const mediaconfig = {
@@ -51,10 +50,9 @@ function streamAuth(path: string){
}
var nms = new NodeMediaServer(mediaconfig);
const nms = new NodeMediaServer(mediaconfig);
nms.run();
ircd.boot();
nms.on('prePublish', (id, StreamPath, args) => {
console.log("[NodeMediaServer] Prepublish Hook for stream id=",id);
@@ -100,4 +98,4 @@ nms.on('postPublish', (id, StreamPath, args) => {
return true;
}
console.log('[NodeMediaServer] Skipping recording for ', `id=${id} StreamPath=${StreamPath}`);
});
});