зеркало из https://github.com/mozilla/pjs.git
Fixing various typos and spelling mistakes spotted by timeless. There shouldn't be any code level changes here. moa=hixie
This commit is contained in:
Родитель
40bfcee8b0
Коммит
3db33a040e
|
@ -18,5 +18,5 @@ Reserved.
|
|||
Contributor(s): Harrison Page <harrison@netscape.com>
|
||||
Terry Weissman <terry@mozilla.org>
|
||||
Risto Kotalampi <risto@kotalampi.com>
|
||||
Josh Soref <timeless@bemail.org>
|
||||
Ian Hickson <py8ieh=mozbot@bath.ac.uk>
|
||||
Josh Soref <timeless@mac.com>
|
||||
Ian Hickson <mozbot@hixie.ch>
|
||||
|
|
|
@ -13,8 +13,9 @@ sub Help {
|
|||
return {
|
||||
'' => 'A module to get random fortune cookies.',
|
||||
'fortune' => 'Same as \'cookie\', which see.',
|
||||
'cookie' => 'To get a fortune cookie, just tell me \'cookie\'. To set a new fortune cookie, see \'new\'. To find out how many cookies are left, use \'cookie status\'.',
|
||||
'cookie' => 'To get a fortune cookie, just tell me \'cookie\'. To set a new fortune cookie, see \'new\' (or \'add\'). To find out how many cookies are left, use \'cookie status\'.',
|
||||
'new' => 'To set a new fortune cookie, say \'new cookie\' followed by the text, e.g. \'new cookie: you will have a nice day\' or whatever. The string %from% will be replaced by the name of whoever requests the cookie.',
|
||||
'add' => 'To add a new fortune cookie, say \'add cookie\' followed by the text, e.g. \'add cookie: you will have a nice day\' or whatever. The string %from% will be replaced by the name of whoever requests the cookie.',
|
||||
'fetch' => 'The command \'fetch cookies from <uri>\' will add each line in <uri> to the cookie list. Cookie lists must start with one line that reads \'FORTUNE COOKIE FILE\'. Blank lines and lines starting with a hash (\'#\') are ignored.',
|
||||
};
|
||||
}
|
||||
|
@ -56,7 +57,7 @@ sub Told {
|
|||
} else {
|
||||
$self->say($event, 'I\'m sorry, I\'ve run out of cookies! You\'ll have to wait for me to bake some more.');
|
||||
}
|
||||
} elsif ($message =~ /^\s*new\s+(?:fortune\s+cookie|fortune|cookie)[-!:,;.\s]+(.....+?)\s*$/osi) {
|
||||
} elsif ($message =~ /^\s*(?:new|add)\s+(?:fortune\s+cookie|fortune|cookie)[-!:,;.\s]+(.....+?)\s*$/osi) {
|
||||
push(@{$self->{'cookies'}}, $1);
|
||||
my $count = scalar(@{$self->{'cookies'}});
|
||||
$self->say($event, "$event->{'from'}: Thanks! I have added that fortune cookie to my recipe book. I now have $count fortunes!");
|
||||
|
|
|
@ -16,7 +16,7 @@ sub Help {
|
|||
'opme' => 'Checks the autoop list, and ops the speaker if they are on the autoop list. Must be used in a channel. Syntax: \'op me\' or \'opme\'',
|
||||
'mask' => 'Add or remove a regexp mask from a channel\'s autoop list. Only bot and channel admins can do this. USE OF THIS FEATURE IS HIGHLY DISCOURAGED AS IT IS VERY INSECURE!!! Syntax: \'add mask <user@host> in <channel>\' to add and \'remove mask <user@host> in <channel>\' to remove. The special word \'everywhere\' can be used instead of a channel name to add a mask that works in all channels.',
|
||||
'autoop' => 'Add someone to the autoop list for a channel. Only bot and channel admins can do this. Syntax: \'op <user> in <channel>\'',
|
||||
'deautoop' => 'Remove someone from the autoop list for a channel. Only bot and channel admins can do this. Syntax: \'deop <user> in <channel>\'',
|
||||
'deautoop' => 'Remove someone from the autoop list for a channel. Only bot and channel admins can do this. Syntax: \'deautoop <user> in <channel>\'',
|
||||
'enable' => 'Enable a module in a channel. Only bot and channel admins can do this. Syntax: \'enable <module> in <channel>\'',
|
||||
'disable' => 'Disable a module in a channel. Only bot and channel admins can do this. Syntax: \'disable <module> in <channel>\'',
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ sub Help {
|
|||
return {
|
||||
'' => 'A polite module for saying hello and goodbye and so on.',
|
||||
'hi' => 'To greet the bot.',
|
||||
'bye' => 'To say good bye to the bot.',
|
||||
'bye' => 'To say goodbye to the bot.',
|
||||
'ping' => 'To check the bot is alive.',
|
||||
'uptime' => 'Gives the amount of time that the bot has been active.',
|
||||
};
|
||||
|
|
|
@ -45,7 +45,7 @@ sub Told {
|
|||
}
|
||||
$self->directSay($event, 'End of wishes.');
|
||||
} else {
|
||||
$self->directSay($event, 'Noone has wished for anything!');
|
||||
$self->directSay($event, 'No-one has wished for anything!');
|
||||
}
|
||||
$self->channelSay($event, "$event->{'from'}: wishlist /msg'ed");
|
||||
} else {
|
||||
|
|
|
@ -197,7 +197,7 @@ set to 1. This won't be a problem if your module only returns 1
|
|||
*** PartedChannel($event, $channel)
|
||||
|
||||
Called after the bot has left a channel, for example if the bot has
|
||||
been /hicked.
|
||||
been /kicked.
|
||||
|
||||
No special return values. Always call inherited the function, as this
|
||||
is where the autopart function is implemented.
|
||||
|
@ -543,7 +543,7 @@ recommended.
|
|||
Example:
|
||||
$self->registerVariables(
|
||||
[ 'ftpDelay', 1, 1, 60 ],
|
||||
[ 'ftpsite', 1, 1, 'ftp.mozilla.org' ],
|
||||
[ 'ftpSite', 1, 1, 'ftp.mozilla.org' ],
|
||||
);
|
||||
|
||||
|
||||
|
@ -700,7 +700,7 @@ recommended.
|
|||
Set the bot's 'away' flag. A blank message will mark the bot as
|
||||
back. Note: If you need this you are doing something wrong!!!
|
||||
Remember that you should not be doing any lengthy processes since if
|
||||
you are away for any length of time, the bot will be kicked!
|
||||
you are away for any length of time, the bot will be disconnected!
|
||||
|
||||
Also note that in 2.0 this is not throttled, so DO NOT call this
|
||||
repeatedly, or put yourself in any position where you allow IRC
|
||||
|
|
|
@ -74,7 +74,11 @@ See the "Administration" section for instructions on how to change the
|
|||
administration password (important!).
|
||||
|
||||
Note: Passwords are printed in clear text on the console and in the
|
||||
log files. Secure them accordingly.
|
||||
log files. Secure them accordingly. Of course, IRC is an inherently
|
||||
insecure protocol anyway, and any machine between your IRC client's
|
||||
and your bot's, going through the IRC network's servers, will have
|
||||
access to the passwords. For this reason, change them often, and don't
|
||||
use passwords that you use for important things here.
|
||||
|
||||
The default setting is for mozbot to run with taint checking
|
||||
enabled. I *STRONGLY* recommend not changing this.
|
||||
|
@ -189,7 +193,6 @@ Now authenticate yourself again, as the new user:
|
|||
The moment you authenticate as the new admin, the default admin
|
||||
account is deleted.
|
||||
|
||||
|
||||
You are now in a position to add the modules you want and to put the
|
||||
bot in the channels you want it in.
|
||||
|
||||
|
@ -214,7 +217,7 @@ the following message:
|
|||
/msg mozbot shutup please
|
||||
|
||||
It should respond within a few seconds. You can authenticate while it
|
||||
is speaking, that is no problem.
|
||||
is speaking, that's not a problem.
|
||||
|
||||
|
||||
VARIABLES
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#
|
||||
# Contributor(s): Harrison Page <harrison@netscape.com>
|
||||
# Terry Weissman <terry@mozilla.org>
|
||||
# Ian Hickson <py8ieh=mozbot@bath.ac.uk>
|
||||
# Ian Hickson <mozbot@hixie.ch>
|
||||
|
||||
package Mails;
|
||||
use strict;
|
||||
|
|
|
@ -130,11 +130,11 @@ $|++;
|
|||
|
||||
# internal 'constants'
|
||||
my $NAME = 'mozbot';
|
||||
my $VERSION = q$Revision: 2.0 $;
|
||||
my $VERSION = q$Revision: 2.1 $;
|
||||
my $USERNAME = "pid-$$";
|
||||
my $LOGFILEPREFIX;
|
||||
|
||||
# adjust the version constants
|
||||
# adjust the version constant
|
||||
$VERSION =~ /([0-9.]+)/;
|
||||
$VERSION = $1;
|
||||
|
||||
|
@ -1448,7 +1448,7 @@ sub getModule {
|
|||
}
|
||||
|
||||
# tellAdmin - may try to talk to an admin.
|
||||
# NO GUARENTEES! This will PROBABLY NOT reach anyone!
|
||||
# NO GUARANTEES! This will PROBABLY NOT reach anyone!
|
||||
sub tellAdmin {
|
||||
my $self = shift;
|
||||
my ($event, $data) = @_;
|
||||
|
@ -1965,7 +1965,7 @@ sub Set {
|
|||
} elsif (ref($self->{$variable}) eq 'HASH') {
|
||||
if ($value =~ /^\+(.)(.*)\1(.*)$/so) {
|
||||
$self->{$variable}->{$2} = $3;
|
||||
return -2 if $1 =~ /[a-zA-Z]/os;
|
||||
return -2 if $1 =~ /[a-zA-Z]/so;
|
||||
} elsif ($value =~ /^\-(.*)$/so) {
|
||||
# XXX no feedback if nothing is done
|
||||
delete($self->{$variable}->{$1});
|
||||
|
@ -2101,8 +2101,8 @@ sub Help {
|
|||
'restart' => 'Shuts the bot down completely then restarts it, so that any source changes take effect.',
|
||||
'cycle' => 'Makes the bot disconnect from the server then try to reconnect.',
|
||||
'vars' => 'Manage variables: vars [<module> [<variable> [\'<value>\']]], say \'vars\' for more details.',
|
||||
'join' => 'Makes the bot attempt to join a channel. You can also use /invite. Syntax: join <channel>',
|
||||
'part' => 'Makes the leave a channel. The same affect can be achieved using /kick. Syntax: part <channel>',
|
||||
'join' => 'Makes the bot attempt to join a channel. The same effect can be achieved using /invite. Syntax: join <channel>',
|
||||
'part' => 'Makes the bot leave a channel. The same effect can be achieved using /kick. Syntax: part <channel>',
|
||||
'load' => 'Loads a module from disk, if it is not already loaded: load <module>',
|
||||
'unload' => 'Unloads a module from memory: load <module>',
|
||||
'reload' => 'Unloads and then loads a module: reload <module>',
|
||||
|
@ -2370,7 +2370,7 @@ sub Invited {
|
|||
# on the server should the bot join first.
|
||||
my $channel = lc($channelName);
|
||||
if (grep($_ eq $channel, @channels)) {
|
||||
$self->directSay($event, "I think already *in* channel $channel! If this is not the case please make me part and then rejoin.");
|
||||
$self->directSay($event, "I think I'm already *in* channel $channel! If this is not the case please make me part and then rejoin.");
|
||||
} else {
|
||||
if ($self->isAdmin($event) || $self->{'allowInviting'}) {
|
||||
$self->debug("Joining $channel, since I was invited.");
|
||||
|
@ -2561,7 +2561,7 @@ sub Told {
|
|||
} else {
|
||||
$self->directSay($event, "Help topics for $NAME $VERSION ($helpline):");
|
||||
$self->say($event, "$event->{'from'}: help info /msg'ed") if ($event->{'channel'});
|
||||
local @" = ', ';
|
||||
local @" = ', '; # to reset font-lock: "
|
||||
my @helplist;
|
||||
foreach my $module (@modules) {
|
||||
my %commands = %{$module->Help($event)};
|
||||
|
@ -2653,6 +2653,7 @@ sub SpottedQuit {
|
|||
my $self = shift;
|
||||
my ($event, $who, $why) = @_;
|
||||
delete($authenticatedUsers{$event->{'user'}});
|
||||
# XXX this doesn't deal with a user who has authenticated twice.
|
||||
return $self->SUPER::SpottedQuit(@_);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче