simplify bot settings

This commit is contained in:
hgw 2023-10-02 02:11:24 +00:00
parent f0c8cc54cc
commit 6d733b06dd
2 changed files with 14 additions and 11 deletions

20
bot.js
View File

@ -8,22 +8,22 @@ const { Worker } = require('worker_threads');
var connconfig = { var connconfig = {
server: config.get('irc.server'), server: config.get('irc.server'),
port: config.get('irc.port'), port: config.get('irc.port'),
SSL: config.get('irc.port'), SSL: config.get('irc.ssl'),
channels: config.get('irc.channels'), channels: config.get('irc.channels'),
botName: config.get('irc.nickname'), botName: config.get('irc.nickname'),
userName: config.get('irc.username'), userName: config.get('irc.username'),
realName: config.get('irc.realname') realName: config.get('irc.realname')
}; };
var bot = new irc.Client(connconfig.server, connconfig.botName, { var bot = new irc.Client(config.get('irc.server'), config.get('irc.nickname'), {
channels: connconfig.channels, channels: config.get('irc.channels'),
secure: connconfig.SSL, secure: config.get('irc.ssl'),
port: connconfig.port, port: config.get('irc.port'),
autoRejoin: true, autoRejoin: config.get('irc.autorejoin'),
userName: connconfig.userName, userName: config.get('irc.username'),
realName: connconfig.realName, realName: config.get('irc.realname'),
floodProtection: false, floodProtection: config.get('irc.floodprotection'),
floodProtectionDelay: 0 floodProtectionDelay: config.get('irc.floodprotectiondelay')
}); });
const timer = ms => new Promise(res => setTimeout(res, ms)) const timer = ms => new Promise(res => setTimeout(res, ms))

View File

@ -8,7 +8,10 @@
], ],
"nickname": "mercury", "nickname": "mercury",
"username": "mercury", "username": "mercury",
"realname": "git.supernets.org/hogwart7/mercury" "realname": "git.supernets.org/hogwart7/mercury",
"autorejoin": "true",
"floodprotection": "false",
"floodprotectiondelay": "0"
}, },
"feed": { "feed": {
"useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13.4; rv:109.0) Gecko/20100101 Firefox/114.0", "useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 13.4; rv:109.0) Gecko/20100101 Firefox/114.0",