Skip to content

Instantly share code, notes, and snippets.

@ferdi2005
Created October 4, 2017 20:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ferdi2005/54152db6832d270dd00842774773d4ec to your computer and use it in GitHub Desktop.
Configurazione di FruitieX/teleirc
var config = {};
module.exports = config;
//////////////////////
// General config //
// Trad. ITA F.T. //
///////////////////
// verbosity of console output
// possible options from most to least verbose:
// silly, debug, verbose, info, warn, error
config.logLevel = 'info';
// metti il token del tuo bot (quello che vedi è un esempio):
config.tgToken = '123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11';
// manda i cambiamenti di "topic" IRC
config.sendTopic = true;
// manda gli ingressi e le uscite da IRC
config.sendNonMsg = false;
// abilita un server HTTP che manda i file che vengono inviati sul gruppo
// direttamente a IRC tramite link
config.showMedia = true;
// Inserisci caratteri random quando vengono mandati file
// usa 0 per disabilitare
config.mediaRandomLength = 8;
// Age in seconds after which a Telegram message is not relayed, this prevents
// spamming the IRC channel if your bot was offline for a long time
config.maxMsgAge = 60;
// Porta del server HTTP (evitare conflitti)
config.httpPort = 9000;
// Posizione del server HTTP da cui sono generati gli url, sostituisci MIOSITO con IP/url collegato alla tua VPS
config.httpLocation = 'http://MIOIP' + ':' + config.httpPort;
// Consenti di mandare comandi IRC e quindi senza il prefisso del nick
config.allowCommands = true;
//////////////////
// IRC config //
//////////////////
// Lascia true
config.nickcolor = true;
// Nick color palette
config.palette = [
'white', 'silver', 'navy',
'green', 'red', 'brown',
'purple', 'olive', 'yellow',
'lime', 'teal', 'cyan',
'pink', 'blue'
];
// If soloUse is true, send all messages without username preview, intented
// to use telegram as a limited IRC client.
config.soloUse = false;
// 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)
config.nameFormat = '%username%';
// fallback format string for %username% if sender lacks username
config.usernameFallbackFormat = '%firstName% %lastName%';
// Replace newline characters in Telegram messages with this string before
// relaying them to IRC, prevents flood from long messages.
//
// Tip: you can set this to \n if you want them as separate messages on IRC
config.replaceNewlines = ' … ';
//Configurara il server IRC inserendo l'username che vuoi usare per il tuo bot ed il link del server IRC
config.ircNick = 'usernamebot';
config.ircServer = 'serverirc.sito.it';
// 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>'
// ]
config.ircPerformCmds = [];
config.channels = [
// configura i canali => vedi conf. ufficiale per esigenze particolari (ad es. canali con password):
// '#canale' verrà connesso con un gruppo telegram che si chiama (proprio di NOME inteso come titolo per esempio se
// il gruppo si chiama "Wikipedia" come titolo e @itwikipedia come user bisogna mettere 'Wikipedia' nel campo gruppo
{
ircChan: '#canale',
tgGroup: 'Nome Gruppo Telegram'
}
];
// vedi https://node-irc.readthedocs.org/en/latest/API.html#client per la documentazione
// 'username' mettiamo quello inserito prima come "ircNick" (sarebbe username che appare su IRC) e 'realName' i dati cha appaiono su IRC
// nel campo "nome reale" Come port mettiamo la porta di IRC (vedi doc. vari provider, lascia così se non sai)
config.ircOptions = {
userName: 'username',
realName: 'NOME REALE (appare in IRC)',
port: 6667,
localAddress: null,
showErrors: false,
autoRejoin: false,
autoConnect: true,
channels: [], // auto generated, do not touch
secure: false,
selfSigned: false,
certExpired: false,
floodProtection: true,
floodProtectionDelay: 1000,
sasl: false,
stripColors: true,
channelPrefixes: '&#!',
messageSplit: 512,
encoding: ''
};
// 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 '! '
var regex = '^ *(?:' + config.ircNick + '[:,]?|!) +(.*\\S.*)$';
config.hlRegexp = new RegExp(regex, 'i');
// if there was a match, should we only show the parenthesized substring match?
// with the default regexp this would hide the bot nickname in messages when
// highlighted
config.hlOnlyShowMatch = false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment