]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/UserDCC.pl
- added top3 irctextcounter stats
[infobot.git] / src / Modules / UserDCC.pl
index 72d08d141c73903bb65a1fdc46ddb1ee32b25bfb..58c67b48ac3b75acf6e3564d57293462b8e80447 100644 (file)
@@ -24,11 +24,11 @@ sub userDCC {
 
     # who.
     if ($message =~ /^who$/) {
-       my $count = scalar(keys %{$dcc{'CHAT'}});
+       my $count = scalar(keys %{ $dcc{'CHAT'} });
        my $dccCHAT = $message;
 
        &pSReply("Start of who ($count users).");
-       foreach (keys %{$dcc{'CHAT'}}) {
+       foreach (keys %{ $dcc{'CHAT'} }) {
            &pSReply("=> $_");
        }
        &pSReply("End of who.");
@@ -38,6 +38,19 @@ sub userDCC {
 
     ### for those users with enough flags.
 
+    if ($message =~ /^tellme(\s+(.*))?$/i) {
+       my $args = $2;
+       if ($args =~ /^\s*$/) {
+           &help("tellme");
+           return;
+       }
+
+       my $result = &doQuestion($args);
+       &pSReply($result);
+
+       return;
+    }
+
     # 4op.
     if ($message =~ /^4op(\s+($mask{chan}))?$/i) {
        return unless (&hasFlag("o"));
@@ -424,6 +437,29 @@ sub userDCC {
        return;
     }
 
+    # reset.
+    if ($message =~ /^reset$/i) {
+       return unless (&hasFlag("n"));
+
+       &msg($who,"resetting...");
+       my @done;
+       foreach ( keys %channels, keys %chanconf ) {
+           next if (grep /^\Q$_\E$/i, @done);
+
+           &part($_);
+
+           push(@done, $_);
+           sleep 1;
+       }
+       &clearIRCVars();
+       &joinNextChan();
+
+       &status("USER reset $who");
+       &msg($who,"resetted");
+
+       return;
+    }
+
     # rehash.
     if ($message =~ /^rehash$/) {
        return unless (&hasFlag("n"));
@@ -660,7 +696,7 @@ sub userDCC {
 
        if (scalar @args == 1) {        # del pass.
            if (!&IsFlag("n") and $who !~ /^\Q$verifyUser\E$/i) {
-               &pSReply("cannto remove passwd of others.");
+               &pSReply("cannot remove passwd of others.");
                return;
            }
 
@@ -709,7 +745,7 @@ sub userDCC {
        }
 
        if (!defined $user) {
-           &pSReply("user $user does not exist.");
+           &pSReply("user does not exist.");
            return;
        }
 
@@ -1084,6 +1120,7 @@ sub userDCC {
 
        &writeUserFile();
        &writeChanFile();
+       &News::writeNews() if (&ChanConfList("news"));
 
        return;
     }