diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index 34364f9a..d6748173 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -659,6 +659,10 @@ sub factmove { return "/say $target already exists for the global channel and cannot be overridden for " . ($target_channel eq '.*' ? 'the global channel' : $target_channel) . "."; } + if ($self->{pbot}->{commands}->exists($target)) { + return "/say $target already exists as a built-in command."; + } + $target_channel = lc $target_channel; $target_channel = '.*' if $target_channel !~ /^#/; @@ -713,6 +717,10 @@ sub factalias { return "/say $alias already exists for the global channel and cannot be overridden for " . ($chan eq '.*' ? 'the global channel' : $chan) . "."; } + if ($self->{pbot}->{commands}->exists($alias)) { + return "/say $alias already exists as a built-in command."; + } + $self->{pbot}->{factoids}->add_factoid('text', $chan, "$nick!$user\@$host", $alias, "/call $command"); $self->{pbot}->{logger}->log("$nick!$user\@$host [$chan] aliased $alias => $command\n"); @@ -803,6 +811,10 @@ sub factadd { return "/say $keyword already exists for the global channel and cannot be overridden for " . ($from_chan eq '.*' ? 'the global channel' : $from_chan) . "."; } + if ($self->{pbot}->{commands}->exists($keyword)) { + return "/say $keyword already exists as a built-in command."; + } + $self->{pbot}->{factoids}->add_factoid('text', $from_chan, "$nick!$user\@$host", $keyword, $text); $self->{pbot}->{logger}->log("$nick!$user\@$host added [$from_chan] $keyword => $text\n");