sub readUserFile {
my $f = "$bot_misc_dir/blootbot.users";
+ if (! -f $f) {
+ &DEBUG("userfile not found; new fresh run detected.");
+ return;
+ }
+
if ( -f $f and -f "$f~") {
my $s1 = -s $f;
my $s2 = -s "$f~";
foreach $user (keys %users) {
next if ($user eq "_default");
- foreach $m (keys %{$users{$user}{HOSTS}}) {
+ foreach $m (keys %{ $users{$user}{HOSTS} }) {
$m =~ s/\?/./g;
$m =~ s/\*/.*?/g;
$m =~ s/([\@\(\)\[\]])/\\$1/g;
$val = 0;
}
- $chanconf{$chan}{$what} = $val;
- &pSReply("Setting $what for $chan to '$val'$was.");
+ if ($val eq "0") {
+ &pSReply("Unsetting $what for $chan$was.");
+ delete $chanconf{$chan}{$what};
+ } else {
+ &pSReply("Setting $what for $chan to '$val'$was.");
+ $chanconf{$chan}{$what} = $val;
+ }
+
$update++;
### ".chanset blah testing"
); # todo...
1;
+
+#####
+# Userflags
+# +r - ability to remove factoids
+# +t - ability to teach factoids
+# +m - ability to modify factoids
+# +n - bot owner
+# +o - authorised user of bot (like +m on eggdrop)
+#####