2017-11-25 13:27:46 +01:00
|
|
|
var config = {};
|
|
|
|
module.exports = config;
|
|
|
|
|
|
|
|
/////////////////////
|
|
|
|
// General config //
|
|
|
|
/////////////////////
|
|
|
|
|
|
|
|
// paste the bot API token you got from BotFather here:
|
2023-02-26 18:01:13 +01:00
|
|
|
config.tgToken = "CENSORED";
|
2017-11-25 13:27:46 +01:00
|
|
|
|
|
|
|
// only relay IRC events present in array
|
|
|
|
// possible values include:
|
|
|
|
// message, notice, action, topic, join, part, kick, quit
|
2023-02-26 18:01:13 +01:00
|
|
|
config.relayIRCEvents = ["message", "notice", "action", "kick", "topic"];
|
2017-11-25 13:27:46 +01:00
|
|
|
|
|
|
|
// enable HTTP server which hosts sent media files, links to files are
|
|
|
|
// forwarded to IRC
|
|
|
|
config.showMedia = true;
|
|
|
|
|
|
|
|
// HTTP server port
|
|
|
|
config.httpPort = 61825;
|
|
|
|
|
|
|
|
// HTTP server location, URLs are generated from this
|
2023-02-26 18:01:13 +01:00
|
|
|
config.httpLocation = "http://silta.piraatit.fi" + ":" + config.httpPort;
|
2017-11-25 13:27:46 +01:00
|
|
|
//config.httpLocation = 'https://t4.mikaela.info';
|
|
|
|
|
|
|
|
//////////////////
|
|
|
|
// IRC config //
|
|
|
|
//////////////////
|
|
|
|
|
|
|
|
// formatting of Telegram usernames on IRC.
|
|
|
|
// the following placeholders are available:
|
|
|
|
//
|
|
|
|
// - %firstName% (first name of sender)
|
|
|
|
// - %lastName% (last name of sender)
|
|
|
|
// - %username% (optional Telegram username of sender)
|
2023-02-26 18:01:13 +01:00
|
|
|
config.nameFormat = "%username%";
|
2017-11-25 13:27:46 +01:00
|
|
|
|
|
|
|
// fallback format string for %username% if sender lacks username
|
2023-02-26 18:01:13 +01:00
|
|
|
config.usernameFallbackFormat =
|
|
|
|
"%firstName% (MISSING @USERNAME! telegram.org/faq#usernames-and-t-me)";
|
2017-11-25 13:27:46 +01:00
|
|
|
|
2023-02-26 18:01:13 +01:00
|
|
|
config.ircNick = "T4";
|
2018-11-15 11:20:23 +01:00
|
|
|
//config.ircServer = 'fi.pirateirc.net';
|
|
|
|
// Yggdrasil
|
2023-02-26 18:01:13 +01:00
|
|
|
config.ircServer = "201:677d:1809:c5eb:202a:d39:e598:305";
|
2017-11-25 13:27:46 +01:00
|
|
|
|
|
|
|
// array of commands to send to IRC server as soon as we're connected,
|
|
|
|
// example: config.ircPerformCmds = [
|
|
|
|
// 'PRIVMSG Q@CServe.quakenet.org :AUTH <username> <password>'
|
|
|
|
// ]
|
|
|
|
|
2023-02-26 18:01:13 +01:00
|
|
|
config.ircPerformCmds = [
|
|
|
|
"NICKSERV identify T4 CENSORED",
|
|
|
|
"NICKSERV regain T4",
|
|
|
|
"mode T4 -i+RQ",
|
|
|
|
"CHANSERV invite #messi",
|
|
|
|
"JOIN #messi",
|
|
|
|
];
|
2017-11-25 13:27:46 +01:00
|
|
|
//config.ircPerformCmds = [];
|
|
|
|
|
|
|
|
config.channels = [
|
2023-02-26 18:01:13 +01:00
|
|
|
{
|
|
|
|
ircChan: "#piraattinuoret",
|
|
|
|
tgGroup: "Piraattinuoret",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#piraatit",
|
|
|
|
tgGroup: "Piraatit",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#mediaseuranta",
|
|
|
|
tgGroup: "PPFI - Mediaseuranta",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#helsinki",
|
|
|
|
tgGroup: "PPFI - Helsinki",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#uusimaa",
|
|
|
|
tgGroup: "PPFI - Uusimaa",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#toiminta",
|
|
|
|
tgGroup: "PPFI - Toiminta",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#puoluetoimisto",
|
|
|
|
tgGroup: "PPFI - Puoluetoimisto",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#verkkopalvelut",
|
|
|
|
tgGroup: "PPFI - Verkkopalvelut",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#pinu_hallitus",
|
|
|
|
tgGroup: "PiNu hallitus",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#keski-suomi",
|
|
|
|
tgGroup: "PPFI - Keski-Suomi",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#sateenkaaripiraatit",
|
|
|
|
tgGroup: "Sateenkaaripiraatit",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#suomiareena",
|
|
|
|
tgGroup: "PPFI - Suomiareena",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#Mikaela",
|
|
|
|
ircChanReadOnly: true,
|
|
|
|
ircChanOverrideReadOnly: true,
|
|
|
|
tgGroup: "##Mikaela",
|
|
|
|
tgGroupReadOnly: true,
|
|
|
|
tgGroupOverrideReadOnly: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#aaltopiraatit",
|
|
|
|
tgGroup: "PPFI - Aaltopiraatit",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#ppfi",
|
|
|
|
tgGroup: "Pirate Party Finland",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#grafiikka",
|
|
|
|
tgGroup: "PPFI - Grafiikka",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#messi",
|
|
|
|
tgGroup: "PPFI - Messi",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#varsinais-suomi",
|
|
|
|
tgGroup: "PPFI - Varsinais-Suomi",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#syotteet",
|
|
|
|
tgGroup: "Syötteet",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#sivusto",
|
|
|
|
tgGroup: "PPFI - Sivusto",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#globalPirates",
|
|
|
|
tgGroup: "Global Pirates",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#antikupla",
|
|
|
|
tgGroup: "Antikupla",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#hame",
|
|
|
|
tgGroup: "PPFI - Häme",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#akateemisetpiraatit",
|
|
|
|
tgGroup: "Akateemiset Piraatit",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#hallituskokous",
|
|
|
|
tgGroup: "PIR - Hallituksen kokoukset",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "T4",
|
|
|
|
tgGroup: "SPAM-TELEIRC-PRIVAT",
|
|
|
|
tgGroupReadOnly: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "*",
|
|
|
|
tgGroup: "SPAM-TELEIRC-PRIVAT",
|
|
|
|
tgGroupReadOnly: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#opers",
|
|
|
|
tgGroup: "PirateIRC Telegram Opers/Staff",
|
|
|
|
tgGroupReadOnly: true,
|
|
|
|
tgGroupOverrideReadOnly: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#satakunta",
|
|
|
|
tgGroup: "PIR - Satakunta",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#viestinta_markkinointi",
|
|
|
|
chanPwd: "CENSORED",
|
|
|
|
tgGroup: "PPFI - Viestintä ja Markkinointi",
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
ircChan: "#TechPirates",
|
|
|
|
tgGroup: "Tech Pirates",
|
|
|
|
},
|
|
|
|
|
|
|
|
//{
|
|
|
|
// ircChan: '#teleirc',
|
|
|
|
// tgGroup: 'teleirc'
|
|
|
|
//}
|
|
|
|
|
|
|
|
// example of a password-protected IRC channel:
|
|
|
|
//{
|
|
|
|
//ircChan: '#channel2',
|
|
|
|
//chanPwd: 'passwd',
|
|
|
|
//tgGroup: 'Tg_Group_2'
|
|
|
|
//},
|
|
|
|
|
|
|
|
// example of an IRC channel with an alias:
|
|
|
|
// channel name will be displayed as '!channel3' instead of '!XXXXXchannel3'
|
|
|
|
//{
|
|
|
|
//ircChan: '!XXXXXchannel3',
|
|
|
|
//chanAlias: '!channel3',
|
|
|
|
//tgGroup: 'Tg_Group_3'
|
|
|
|
//}
|
2017-11-25 13:27:46 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
// see https://node-irc.readthedocs.org/en/latest/API.html#client for
|
|
|
|
// documentation
|
|
|
|
config.ircOptions = {
|
2023-02-26 18:01:13 +01:00
|
|
|
userName: "Telegram",
|
|
|
|
realName: "mailto:pikaviestimet+PircTGRelay@piraattipuolue.fi",
|
|
|
|
port: 6697,
|
|
|
|
localAddress: null,
|
|
|
|
debug: false,
|
|
|
|
showErrors: true,
|
|
|
|
autoRejoin: true,
|
|
|
|
autoConnect: true,
|
|
|
|
channels: [], // auto generated, do not touch
|
|
|
|
secure: true,
|
|
|
|
// TRUE JOS EPÄKELPO!
|
|
|
|
// Yggdrasil
|
|
|
|
//selfSigned: false,
|
|
|
|
//certExpired: false,
|
|
|
|
selfSigned: true,
|
|
|
|
certExpired: true,
|
|
|
|
floodProtection: true,
|
|
|
|
floodProtectionDelay: 1000,
|
|
|
|
sasl: true,
|
|
|
|
//sasl: false,
|
|
|
|
stripColors: true,
|
|
|
|
channelPrefixes: "&#!",
|
|
|
|
messageSplit: 512,
|
|
|
|
encoding: "",
|
|
|
|
//password: ''
|
|
|
|
password: "CENSORED",
|
2017-11-25 13:27:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// if you wish to relay every irc message to telegram, set this to true.
|
|
|
|
// if false, then only lines matching config.hlRegexp will be relayed
|
|
|
|
config.ircRelayAll = true;
|
|
|
|
|
|
|
|
// the default hilight regexp will match lines containing the bot nick, or
|
|
|
|
// lines starting with '! '
|
2023-02-26 18:01:13 +01:00
|
|
|
var regex = "^ *(?:" + config.ircNick + "[:,]?|!) +(.*\\S.*)$";
|
|
|
|
config.hlRegexp = new RegExp(regex, "i");
|
2017-11-25 13:27:46 +01:00
|
|
|
|
|
|
|
// automatically added by config upgrade:
|
2018-11-15 11:20:23 +01:00
|
|
|
config.logLevel = "error";
|
|
|
|
config.mediaRandomLength = 10;
|
2017-11-25 13:27:46 +01:00
|
|
|
config.maxMsgAge = 60;
|
|
|
|
config.allowCommands = true;
|
|
|
|
config.nickcolor = false;
|
2023-02-26 18:01:13 +01:00
|
|
|
config.palette = [
|
|
|
|
"white",
|
|
|
|
"silver",
|
|
|
|
"navy",
|
|
|
|
"green",
|
|
|
|
"red",
|
|
|
|
"brown",
|
|
|
|
"purple",
|
|
|
|
"olive",
|
|
|
|
"yellow",
|
|
|
|
"lime",
|
|
|
|
"teal",
|
|
|
|
"cyan",
|
|
|
|
"pink",
|
|
|
|
"blue",
|
|
|
|
];
|
2017-11-25 13:27:46 +01:00
|
|
|
config.soloUse = false;
|
|
|
|
config.replaceNewlines = " … ";
|
|
|
|
config.hlOnlyShowMatch = false;
|
|
|
|
|
|
|
|
// automatically added by config upgrade:
|
|
|
|
//config.httpLocation = "http://mydomain.com:9090";
|
|
|
|
config.uploadToImgur = false;
|
|
|
|
config.imgurClientId = "CENSORED";
|
|
|
|
|
|
|
|
// automatically added by config upgrade:
|
|
|
|
config.replySnippetLength = 46;
|
|
|
|
config.mediaConversions = {
|
2023-02-26 18:01:13 +01:00
|
|
|
webp: "png",
|
2017-11-25 13:27:46 +01:00
|
|
|
};
|
|
|
|
config.emphasizeAction = true;
|
2018-11-15 11:20:23 +01:00
|
|
|
config.relayEdited = true;
|