Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var config = {};
  2. module.exports = config;
  3.  
  4. /////////////////////
  5. //  General config //
  6. /////////////////////
  7.  
  8. // verbosity of console output
  9. // possible options from most to least verbose:
  10. // silly, debug, verbose, info, warn, error
  11. config.logLevel = 'info';
  12.  
  13. // paste the bot API token you got from BotFather here:
  14. config.tgToken = '512**************************hoiU';
  15.  
  16. // only relay IRC events present in array
  17. // possible values include:
  18. // message, notice, action, topic, join, part, kick, quit
  19. config.relayIRCEvents = ['message', 'notice', 'action', 'topic', 'kick'];
  20.  
  21. // The maximum length of quoted message when a message is replied to in Telegram
  22. // Set to 0 to disable showing replies
  23. config.replySnippetLength = 80;
  24.  
  25. // enable HTTP server which hosts sent media files, links to files are
  26. // forwarded to IRC
  27. config.showMedia = false;
  28.  
  29. // Convert these media files to other types using the "convert" command.
  30. // To be able to convert from WebP, install imagemagick and the dwebp tool
  31. // (e.g. sudo apt install imagemagick webp)
  32. config.mediaConversions = {
  33.     //'webp': 'png'
  34. };
  35.  
  36. // Add some randomness to url when relaying media
  37. // Use 0 to disable
  38. config.mediaRandomLength = 8;
  39.  
  40. // Age in seconds after which a Telegram message is not relayed, this prevents
  41. // spamming the IRC channel if your bot was offline for a long time
  42. config.maxMsgAge = 60;
  43.  
  44. // HTTP server port
  45. config.httpPort = 9090;
  46.  
  47. // HTTP server location, URLs are generated from this
  48. config.httpLocation = 'http://mydomain.com' + ':' + config.httpPort;
  49.  
  50. // Upload sent photos to Imgur, links to Imgur uploads are
  51. // forwared to IRC
  52. config.uploadToImgur = false;
  53.  
  54. // Imgur client id required for uploading photos to Imgur
  55. config.imgurClientId = 'YOUR-CLIENT-ID';
  56.  
  57. // Whether to allow sending messages to IRC without nick prefix
  58. config.allowCommands = false;
  59.  
  60. //////////////////
  61. //  IRC config  //
  62. //////////////////
  63.  
  64. // Colorizes nicks
  65. config.nickcolor = true;
  66.  
  67. // Nick color palette
  68. config.palette = [
  69.     'white', 'silver', 'navy',
  70.     'green', 'red', 'brown',
  71.     'purple', 'olive', 'yellow',
  72.     'lime', 'teal', 'cyan',
  73.     'pink', 'blue'
  74. ];
  75.  
  76. // If soloUse is true, send all messages without username preview, intented
  77. // to use telegram as a limited IRC client.
  78. config.soloUse = false;
  79.  
  80. // formatting of Telegram usernames on IRC.
  81. // the following placeholders are available:
  82. //
  83. // - %firstName% (first name of sender)
  84. // - %lastName% (last name of sender)
  85. // - %username% (optional Telegram username of sender)
  86. config.nameFormat = '%username%';
  87.  
  88. // fallback format string for %username% if sender lacks username
  89. config.usernameFallbackFormat = '%firstName% %lastName%';
  90.  
  91. // Replace newline characters in Telegram messages with this string before
  92. // relaying them to IRC, prevents flood from long messages.
  93. //
  94. // Tip: you can set this to \n if you want them as separate messages on IRC
  95. config.replaceNewlines = ' … ';
  96.  
  97. config.ircNick = 'tgBot';
  98. config.ircServer = 'herbert.freenode.net';
  99.  
  100. // array of commands to send to IRC server as soon as we're connected,
  101. // example: config.ircPerformCmds = [
  102. //     'PRIVMSG Q@CServe.quakenet.org :AUTH <username> <password>'
  103. // ]
  104. config.ircPerformCmds = [];
  105.  
  106. config.channels = [
  107.     // example of a barebones IRC channel:
  108.     // '#channel1' will be bridged to a Telegram group called 'Tg_Group_1'
  109.     {
  110.         ircChan: '#whu_trade',
  111.         tgGroup: '武大供需撮合平台-tg'
  112.     }
  113. //
  114. //    // example of a password-protected IRC channel:
  115. //    {
  116. //        ircChan: '#channel2',
  117. //        chanPwd: 'passwd',
  118. //        tgGroup: 'Tg_Group_2'
  119. //    },
  120. //
  121. //    // example of a readOnly IRC channel and Telegram Group:
  122. //    {
  123. //        ircChan: '#channel3',
  124. //        ircChanReadOnly: true,          // if true, irc can not send to telegram
  125. //        ircChanOverrideReadOnly: false, // if true, override readonly by highlighting the bot
  126. //        tgGroup: 'Tg_Group_3',
  127. //        tgGroupReadOnly: true,          // if true, telegram can not send to irc
  128. //        tgGroupOverrideReadOnly: true,  // if true, override readonly by highlighting the bot
  129. //    },
  130. //
  131. //    // example of an IRC channel with an alias:
  132. //    // channel name will be displayed as '!channel3' instead of '!XXXXXchannel3'
  133. //    {
  134. //        ircChan: '!XXXXXchannel3',
  135. //        chanAlias: '!channel3',
  136. //        tgGroup: 'Tg_Group_3'
  137. //    }
  138. ];
  139.  
  140. // see https://node-irc.readthedocs.org/en/latest/API.html#client for
  141. // documentation
  142. config.ircOptions = {
  143.     userName: 'bot',
  144.     realName: 'Telegram IRC Bot',
  145.     port: 6667,
  146.     password: '',
  147.     localAddress: null,
  148.     showErrors: false,
  149.     autoRejoin: false,
  150.     autoConnect: true,
  151.     channels: [], // auto generated, do not touch
  152.     secure: false,
  153.     selfSigned: false,
  154.     certExpired: false,
  155.     floodProtection: true,
  156.     floodProtectionDelay: 1000,
  157.     sasl: false,
  158.     stripColors: true,
  159.     channelPrefixes: '&#!',
  160.     messageSplit: 512,
  161.     encoding: ''
  162. };
  163.  
  164. // the default hilight regexp will match lines containing the bot nick, or
  165. // lines starting with '! '
  166. var regex = '^ *(?:' + config.ircNick + '[:,]?|!) +(.*\\S.*)$';
  167. config.hlRegexp = new RegExp(regex, 'i');
  168.  
  169. // if there was a match, should we only show the parenthesized substring match?
  170. // with the default regexp this would hide the bot nickname in messages when
  171. // highlighted
  172. config.hlOnlyShowMatch = false;
  173.  
  174. // put action messages (posted with /me in IRC) between '*'
  175. config.emphasizeAction = true;
  176.  
  177. // a list of users to ignore
  178. // and not relay to telegram
  179. config.ircIgnoreList = [
  180. // 'user_or_bot_here'
  181. ];
  182.  
  183. // list of regular expressions to test a message
  184. // text with, any that match will mean the message won't relay
  185. config.ircRegexFilters = [
  186. // /regexhere/,
  187. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement