3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-26 04:32:37 +01:00

weird config

This commit is contained in:
reality 2018-03-01 14:15:35 +00:00
parent 7d31560458
commit 9a4a86c6ba

View File

@ -7,6 +7,11 @@
var _ = require('underscore')._; var _ = require('underscore')._;
var kill_namespam = function(dbot) { var kill_namespam = function(dbot) {
this.saveConfig = function() { // eugh
dbot.config.modules.kill_namespam = this.config;
dbot.modules.admin.internalAPI.saveConfig();
}.bind(this);
this.listener = function(event) { this.listener = function(event) {
// Here we listen for atropos // Here we listen for atropos
if(event.channel == this.config.cliconn_channel) { if(event.channel == this.config.cliconn_channel) {
@ -76,27 +81,27 @@ var kill_namespam = function(dbot) {
this.commands = { this.commands = {
'~add_spamkill': function(event) { '~add_spamkill': function(event) {
this.config.advert_content.push(event.params.slice(1).join(' ')) this.config.advert_content.push(event.params.slice(1).join(' '))
dbot.modules.admin.internalAPI.saveConfig(); this.saveConfig();
event.reply('Users daring to utter the above to be classified as spam.'); event.reply('Users daring to utter the above to be classified as spam.');
}, },
'~del_spamkill': function(event) { '~del_spamkill': function(event) {
this.config.advert_content = _.without(this.config.advert_content, event.params.slice(1).join(' ')); this.config.advert_content = _.without(this.config.advert_content, event.params.slice(1).join(' '));
dbot.modules.admin.internalAPI.saveConfig(); this.saveConfig();
event.reply('Users will no longer be killed for this utterance.'); event.reply('Users will no longer be killed for this utterance.');
}, },
'~add_clikill': function(event) { '~add_clikill': function(event) {
var pattern = event.params.slice(1).join(' '); var pattern = event.params.slice(1).join(' ');
this.config.cliconn_patterns.push(pattern); this.config.cliconn_patterns.push(pattern);
dbot.modules.admin.internalAPI.saveConfig(); this.saveConfig();
event.reply('Client connection notices matching pattern /'+ pattern +'/ shall henceforth get rekt.'); event.reply('Client connection notices matching pattern /'+ pattern +'/ shall henceforth get rekt.');
}, },
'~del_clikill': function(event) { '~del_clikill': function(event) {
var pattern = event.params.slice(1).join(' '); var pattern = event.params.slice(1).join(' ');
this.config.cliconn_patterns = _.without(this.config.cliconn_patterns, pattern); this.config.cliconn_patterns = _.without(this.config.cliconn_patterns, pattern);
dbot.modules.admin.internalAPI.saveConfig(); this.saveConfig();
event.reply('Client connection notices matching pattern /'+ pattern +'/ will no longer get rekt.'); event.reply('Client connection notices matching pattern /'+ pattern +'/ will no longer get rekt.');
}, },