mirror of
https://git.waldn.net/git/knotteye/satyr.git
synced 2025-11-02 00:02:44 +00:00
Added setup script for inspIRCd
Added bot script for registering and unregistering permanent channels TODO: inspircd config template
This commit is contained in:
33
src/chanbot.ts
Normal file
33
src/chanbot.ts
Normal 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();
|
||||
});
|
||||
}
|
||||
@@ -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}`);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user