mirror of
https://github.com/LBRYFoundation/lbry-wunderbot.git
synced 2025-08-23 17:47:27 +00:00
Add enabled flag for claimbot and irc-bridge to config
update configuration
This commit is contained in:
parent
01755d7a2f
commit
de593f247c
4 changed files with 16 additions and 18 deletions
|
@ -5,7 +5,7 @@ const Discord = require('discord.js');
|
|||
// Load config!
|
||||
let config = require('config');
|
||||
config = config.get('bot');
|
||||
|
||||
let genconfig = require('config');
|
||||
//load modules
|
||||
const claimbot = require('./modules/claimbot.js');
|
||||
const commandsV2 = require('./modules/commandsV2.js');
|
||||
|
@ -47,7 +47,9 @@ bot.on('ready', function() {
|
|||
bot.user.setActivity(config.prefix + 'help', { type: 'LISTENING' }).catch(console.error);
|
||||
|
||||
//initialize the claimbot (content bot)
|
||||
claimbot.init(bot);
|
||||
if(genconfig.get('claimbot').enabled) {
|
||||
claimbot.init(bot);
|
||||
}
|
||||
//initialize the commandsBot
|
||||
commandsV2.init(bot);
|
||||
//initialize the support bot
|
||||
|
|
|
@ -16,12 +16,13 @@ function init(discordBot_) {
|
|||
if (discordBot) {
|
||||
throw new Error('init was already called once');
|
||||
}
|
||||
|
||||
discordBot = discordBot_;
|
||||
console.log('Activating claimbot');
|
||||
discordBot.channels.get(channels[0]).send('activating claimbot');
|
||||
setInterval(announceClaims, 60 * 1000);
|
||||
announceClaims();
|
||||
if (config.get(channels) !== null) {
|
||||
discordBot = discordBot_;
|
||||
console.log('Activating claimbot');
|
||||
discordBot.channels.get(channels[0]).send('activating claimbot');
|
||||
setInterval(announceClaims, 60 * 1000);
|
||||
announceClaims();
|
||||
}
|
||||
}
|
||||
|
||||
function announceClaims() {
|
||||
|
|
|
@ -4,5 +4,7 @@ const ircconfig = config.get('irc');
|
|||
exports.custom = ['irc'];
|
||||
|
||||
exports.irc = function(bot) {
|
||||
discordIRC([ircconfig]);
|
||||
if(ircconfig.enabled) {
|
||||
discordIRC([ircconfig]);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -9,15 +9,6 @@
|
|||
"perms": ["Moderator Team", "LBRY TEAM"], // Roles that have access to all commands.
|
||||
"logchannel": "371620338263523328" // Channel to log the bots moderation..
|
||||
},
|
||||
"lbrycrd": {
|
||||
"host": "localhost",
|
||||
"port": 9245,
|
||||
"user": "USERHERE",
|
||||
"pass": "PASSWORDHERE"
|
||||
},
|
||||
"mongodb": {
|
||||
"url": "mongodb://localhost:27017/wunderbot"
|
||||
},
|
||||
"Channels": {
|
||||
"verification": "571001864271691805",
|
||||
"mining": "363049669636390913",
|
||||
|
@ -59,6 +50,7 @@
|
|||
"mainchannel": "363050205043621908" // Main Stats Bot channel for directing with help message
|
||||
},
|
||||
"claimbot": {
|
||||
"enabled": false,
|
||||
"channels": ["363086719391629326"]
|
||||
},
|
||||
"rolelist": {
|
||||
|
@ -66,6 +58,7 @@
|
|||
"allowedroles": ["NSFW", "Traders", "Miners", "Off-Topic Chats", "International", "Dev"]
|
||||
},
|
||||
"irc": {
|
||||
"enabled": false,
|
||||
"nickname": "wunderbot",
|
||||
"server": "chat.freenode.net",
|
||||
"discordToken": "",
|
||||
|
|
Loading…
Add table
Reference in a new issue