mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 11:42:35 +01:00
Add repo_module to registry to customize source URL in factinfo command
This commit is contained in:
parent
7d874463fd
commit
b289fd155e
@ -54,6 +54,8 @@ sub initialize {
|
||||
|
||||
$self->{pbot} = $pbot;
|
||||
|
||||
$pbot->{registry}->add_default('text', 'general', 'module_repo', $conf{module_repo} // 'https://github.com/pragma-/pbot/blob/master/modules/');
|
||||
|
||||
$pbot->{commands}->register(sub { return $self->factadd(@_) }, "learn", 0);
|
||||
$pbot->{commands}->register(sub { return $self->factadd(@_) }, "factadd", 0);
|
||||
$pbot->{commands}->register(sub { return $self->factrem(@_) }, "forget", 0);
|
||||
@ -587,7 +589,8 @@ sub factinfo {
|
||||
|
||||
# module
|
||||
if($factoids->{$channel}->{$trigger}->{type} eq 'module') {
|
||||
return "$trigger: Module loaded by " . $factoids->{$channel}->{$trigger}->{owner} . " for $chan on " . localtime($factoids->{$channel}->{$trigger}->{created_on}) . " [$created_ago] -> http://code.google.com/p/pbot2-pl/source/browse/trunk/modules/" . $factoids->{$channel}->{$trigger}->{action} . ", used " . $factoids->{$channel}->{$trigger}->{ref_count} . " times (last by " . $factoids->{$channel}->{$trigger}->{ref_user} . (exists $factoids->{$channel}->{$trigger}->{last_referenced_on} ? " on " . localtime($factoids->{$channel}->{$trigger}->{last_referenced_on}) . " [$ref_ago]" : "") . ")";
|
||||
my $module_repo = $self->{pbot}->{registry}->get_value('general', 'module_repo');
|
||||
return "$trigger: Module loaded by " . $factoids->{$channel}->{$trigger}->{owner} . " for $chan on " . localtime($factoids->{$channel}->{$trigger}->{created_on}) . " [$created_ago] -> $module_repo" . $factoids->{$channel}->{$trigger}->{action} . ", used " . $factoids->{$channel}->{$trigger}->{ref_count} . " times (last by " . $factoids->{$channel}->{$trigger}->{ref_user} . (exists $factoids->{$channel}->{$trigger}->{last_referenced_on} ? " on " . localtime($factoids->{$channel}->{$trigger}->{last_referenced_on}) . " [$ref_ago]" : "") . ")";
|
||||
}
|
||||
|
||||
# regex
|
||||
|
@ -13,7 +13,7 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 808,
|
||||
BUILD_REVISION => 810,
|
||||
BUILD_DATE => "2014-12-29",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user