3
0
mirror of https://github.com/pragma-/pbot.git synced 2025-02-17 22:10:44 +01:00

Remove redundant _name metadata from JSON files

This commit is contained in:
Pragmatic Software 2020-04-22 16:46:09 -07:00
parent d2642d07bd
commit 66f6d867e9
20 changed files with 251 additions and 476 deletions

View File

@ -95,7 +95,7 @@ sub ban_exempt {
my $text = "Ban-evasion exemptions:\n"; my $text = "Ban-evasion exemptions:\n";
my $entries = 0; my $entries = 0;
foreach my $channel ($self->{'ban-exemptions'}->get_keys) { foreach my $channel ($self->{'ban-exemptions'}->get_keys) {
$text .= ' ' . $self->{'ban-exemptions'}->get_data($channel, '_name') . ":\n"; $text .= ' ' . $self->{'ban-exemptions'}->get_key_name($channel) . ":\n";
foreach my $mask ($self->{'ban-exemptions'}->get_keys($channel)) { foreach my $mask ($self->{'ban-exemptions'}->get_keys($channel)) {
$text .= " $mask,\n"; $text .= " $mask,\n";
$entries++; $entries++;

View File

@ -68,9 +68,9 @@ sub antispam_cmd {
my $text = "Spam keywords:\n"; my $text = "Spam keywords:\n";
my $entries = 0; my $entries = 0;
foreach my $namespace ($self->{keywords}->get_keys) { foreach my $namespace ($self->{keywords}->get_keys) {
$text .= ' ' . $self->{keywords}->get_data($namespace, '_name') . ":\n"; $text .= ' ' . $self->{keywords}->get_key_name($namespace) . ":\n";
foreach my $keyword ($self->{keywords}->get_keys($namespace)) { foreach my $keyword ($self->{keywords}->get_keys($namespace)) {
$text .= ' ' . $self->{keywords}->get_data($namespace, $keyword, '_name') . ",\n"; $text .= ' ' . $self->{keywords}->get_key_name($namespace, $keyword) . ",\n";
$entries++; $entries++;
} }
} }
@ -84,7 +84,7 @@ sub antispam_cmd {
if (not $self->{keywords}->exists($namespace)) { return "There is no such namespace `$namespace`."; } if (not $self->{keywords}->exists($namespace)) { return "There is no such namespace `$namespace`."; }
if (not $self->{keywords}->exists($namespace, $keyword)) { if (not $self->{keywords}->exists($namespace, $keyword)) {
return "There is no such regex `$keyword` for namespace `" . $self->{keywords}->get_data($namespace, '_name') . '`.'; return "There is no such regex `$keyword` for namespace `" . $self->{keywords}->get_key_name($namespace) . '`.';
} }
if (not defined $flag) { if (not defined $flag) {

View File

@ -165,7 +165,7 @@ sub capcmd {
if (@matches) { if (@matches) {
$result .= '; ' if $matched; $result .= '; ' if $matched;
my $global = $matched ? 'global: ' : ''; my $global = $matched ? 'global: ' : '';
$result .= $users->get_data($channel, '_name') eq '.*' ? $global : $users->get_data($channel, '_name') . ': '; $result .= $users->get_key_name($channel) eq '.*' ? $global : $users->get_key_name($channel) . ': ';
$result .= join ', ', @matches; $result .= join ', ', @matches;
$matched = 1; $matched = 1;
} }

View File

@ -101,7 +101,7 @@ sub list {
my ($self, $from, $nick, $user, $host, $arguments) = @_; my ($self, $from, $nick, $user, $host, $arguments) = @_;
my $result; my $result;
foreach my $channel (sort $self->{channels}->get_keys) { foreach my $channel (sort $self->{channels}->get_keys) {
$result .= $self->{channels}->get_data($channel, '_name') . ': {'; $result .= $self->{channels}->get_key_name($channel) . ': {';
my $comma = ' '; my $comma = ' ';
foreach my $key (sort $self->{channels}->get_keys($channel)) { foreach my $key (sort $self->{channels}->get_keys($channel)) {
$result .= "$comma$key => " . $self->{channels}->get_data($channel, $key); $result .= "$comma$key => " . $self->{channels}->get_data($channel, $key);
@ -117,7 +117,7 @@ sub autojoin {
return if $self->{pbot}->{joined_channels}; return if $self->{pbot}->{joined_channels};
my $channels; my $channels;
foreach my $channel ($self->{channels}->get_keys) { foreach my $channel ($self->{channels}->get_keys) {
if ($self->{channels}->get_data($channel, 'enabled')) { $channels .= $self->{channels}->get_data($channel, '_name') . ','; } if ($self->{channels}->get_data($channel, 'enabled')) { $channels .= $self->{channels}->get_key_name($channel) . ','; }
} }
$self->{pbot}->{logger}->log("Joining channels: $channels\n"); $self->{pbot}->{logger}->log("Joining channels: $channels\n");
$self->{pbot}->{chanops}->join_channel($channels); $self->{pbot}->{chanops}->join_channel($channels);

View File

@ -174,7 +174,7 @@ sub help {
# check built-in commands first # check built-in commands first
if ($self->exists($keyword)) { if ($self->exists($keyword)) {
if ($self->{metadata}->exists($keyword)) { if ($self->{metadata}->exists($keyword)) {
my $name = $self->{metadata}->get_data($keyword, '_name'); my $name = $self->{metadata}->get_key_name($keyword);
my $requires_cap = $self->{metadata}->get_data($keyword, 'requires_cap'); my $requires_cap = $self->{metadata}->get_data($keyword, 'requires_cap');
my $help = $self->{metadata}->get_data($keyword, 'help'); my $help = $self->{metadata}->get_data($keyword, 'help');
my $result = "/say $name: "; my $result = "/say $name: ";
@ -216,8 +216,8 @@ sub help {
($channel, $trigger) = ($factoids[0]->[0], $factoids[0]->[1]); ($channel, $trigger) = ($factoids[0]->[0], $factoids[0]->[1]);
} }
my $channel_name = $self->{pbot}->{factoids}->{factoids}->get_data($channel, '_name'); my $channel_name = $self->{pbot}->{factoids}->{factoids}->get_key_name($channel);
my $trigger_name = $self->{pbot}->{factoids}->{factoids}->get_data($channel, $trigger, '_name'); my $trigger_name = $self->{pbot}->{factoids}->{factoids}->get_key_name($channel, $trigger);
$channel_name = 'global channel' if $channel_name eq '.*'; $channel_name = 'global channel' if $channel_name eq '.*';
$trigger_name = "\"$trigger_name\"" if $trigger_name =~ / /; $trigger_name = "\"$trigger_name\"" if $trigger_name =~ / /;

View File

@ -67,9 +67,10 @@ sub load {
# and lowercase any non-lowercased entries # and lowercase any non-lowercased entries
foreach my $primary_index (keys %{$self->{hash}}) { foreach my $primary_index (keys %{$self->{hash}}) {
if (not exists $self->{hash}->{$primary_index}->{_name}) { if (not exists $self->{hash}->{$primary_index}->{_name}) {
if (lc $primary_index eq $primary_index) { $self->{hash}->{$primary_index}->{_name} = $primary_index; } if ($primary_index ne lc $primary_index) {
else { if (exists $self->{hash}->{lc $primary_index}) {
if (exists $self->{hash}->{lc $primary_index}) { Carp::croak "Cannot update $self->{name} primary index $primary_index; duplicate object found"; } Carp::croak "Cannot update $self->{name} primary index $primary_index; duplicate object found";
}
my $data = delete $self->{hash}->{$primary_index}; my $data = delete $self->{hash}->{$primary_index};
$data->{_name} = $primary_index; $data->{_name} = $primary_index;
@ -78,11 +79,9 @@ sub load {
} }
} }
foreach my $secondary_index (keys %{$self->{hash}->{$primary_index}}) { foreach my $secondary_index (grep { $_ ne '_name' } keys %{$self->{hash}->{$primary_index}}) {
next if $secondary_index eq '_name';
if (not exists $self->{hash}->{$primary_index}->{$secondary_index}->{_name}) { if (not exists $self->{hash}->{$primary_index}->{$secondary_index}->{_name}) {
if (lc $secondary_index eq $secondary_index) { $self->{hash}->{$primary_index}->{$secondary_index}->{_name} = $secondary_index; } if ($secondary_index ne lc $secondary_index) {
else {
if (exists $self->{hash}->{$primary_index}->{lc $secondary_index}) { if (exists $self->{hash}->{$primary_index}->{lc $secondary_index}) {
Carp::croak "Cannot update $self->{name} $primary_index sub-object $secondary_index; duplicate object found"; Carp::croak "Cannot update $self->{name} $primary_index sub-object $secondary_index; duplicate object found";
} }
@ -142,7 +141,7 @@ sub levenshtein_matches {
my $length = (length $primary_index > length $index) ? length $primary_index : length $index; my $length = (length $primary_index > length $index) ? length $primary_index : length $index;
if ($distance_result / $length < $distance) { if ($distance_result / $length < $distance) {
my $name = $self->{hash}->{$index}->{_name}; my $name = $self->get_key_name($index);
if ($name =~ / /) { $result .= $comma . "\"$name\""; } if ($name =~ / /) { $result .= $comma . "\"$name\""; }
else { $result .= $comma . $name; } else { $result .= $comma . $name; }
$comma = ", "; $comma = ", ";
@ -156,7 +155,7 @@ sub levenshtein_matches {
my $header = ""; my $header = "";
foreach my $index1 (sort keys %{$self->{hash}}) { foreach my $index1 (sort keys %{$self->{hash}}) {
$header = "[$self->{hash}->{$index1}->{_name}] "; $header = "[" . $self->get_key_name($index1) . "] ";
$header = '[global] ' if $header eq '[.*] '; $header = '[global] ' if $header eq '[.*] ';
if ($strictnamespace) { if ($strictnamespace) {
@ -169,7 +168,7 @@ sub levenshtein_matches {
my $length = (length $secondary_index > length $index2) ? length $secondary_index : length $index2; my $length = (length $secondary_index > length $index2) ? length $secondary_index : length $index2;
if ($distance_result / $length < $distance) { if ($distance_result / $length < $distance) {
my $name = $self->{hash}->{$index1}->{$index2}->{_name}; my $name = $self->get_key_name($index1, $index2);
$header = "" if $last_header eq $header; $header = "" if $last_header eq $header;
$last_header = $header; $last_header = $header;
$comma = '; ' if $comma ne '' and $header ne ''; $comma = '; ' if $comma ne '' and $header ne '';
@ -199,13 +198,13 @@ sub set {
if (not exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}) { if (not exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}) {
my $secondary_text = $secondary_index =~ / / ? "\"$secondary_index\"" : $secondary_index; my $secondary_text = $secondary_index =~ / / ? "\"$secondary_index\"" : $secondary_index;
my $result = "$self->{name}: [$self->{hash}->{$lc_primary_index}->{_name}] $secondary_text not found; similiar matches: "; my $result = "$self->{name}: [" . $self->get_key_name($lc_primary_index) . "] $secondary_text not found; similiar matches: ";
$result .= $self->levenshtein_matches($primary_index, $secondary_index); $result .= $self->levenshtein_matches($primary_index, $secondary_index);
return $result; return $result;
} }
my $name1 = $self->{hash}->{$lc_primary_index}->{_name}; my $name1 = $self->get_key_name($lc_primary_index);
my $name2 = $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{_name}; my $name2 = $self->get_key_name($lc_primary_index, $lc_secondary_index);
$name1 = 'global' if $name1 eq '.*'; $name1 = 'global' if $name1 eq '.*';
$name2 = "\"$name2\"" if $name2 =~ / /; $name2 = "\"$name2\"" if $name2 =~ / /;
@ -242,7 +241,7 @@ sub unset {
return $result; return $result;
} }
my $name1 = $self->{hash}->{$lc_primary_index}->{_name}; my $name1 = $self->get_key_name($lc_primary_index);
$name1 = 'global' if $name1 eq '.*'; $name1 = 'global' if $name1 eq '.*';
if (not exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}) { if (not exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}) {
@ -251,7 +250,7 @@ sub unset {
return $result; return $result;
} }
my $name2 = $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{_name}; my $name2 = $self->get_key_name($lc_primary_index, $lc_secondary_index);
$name2 = "\"$name2\"" if $name2 =~ / /; $name2 = "\"$name2\"" if $name2 =~ / /;
if (defined delete $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{$key}) { if (defined delete $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{$key}) {
@ -275,6 +274,32 @@ sub exists {
return exists $self->{hash}->{$primary_index}->{$secondary_index}->{$data_index}; return exists $self->{hash}->{$primary_index}->{$secondary_index}->{$data_index};
} }
sub get_key_name {
my ($self, $primary_index, $secondary_index) = @_;
my $lc_primary_index = lc $primary_index;
return $lc_primary_index if not exists $self->{hash}->{$lc_primary_index};
if (not defined $secondary_index) {
if (exists $self->{hash}->{$lc_primary_index}->{_name}) {
return $self->{hash}->{$lc_primary_index}->{_name};
} else {
return $lc_primary_index;
}
}
my $lc_secondary_index = lc $secondary_index;
return $lc_secondary_index if not exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index};
if (exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{_name}) {
return $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{_name};
} else {
return $lc_secondary_index;
}
}
sub get_keys { sub get_keys {
my ($self, $primary_index, $secondary_index) = @_; my ($self, $primary_index, $secondary_index) = @_;
return grep { $_ ne '$metadata$' } keys %{$self->{hash}} if not defined $primary_index; return grep { $_ ne '$metadata$' } keys %{$self->{hash}} if not defined $primary_index;
@ -310,15 +335,22 @@ sub add {
my $lc_secondary_index = lc $secondary_index; my $lc_secondary_index = lc $secondary_index;
if (not exists $self->{hash}->{$lc_primary_index}) { if (not exists $self->{hash}->{$lc_primary_index}) {
$self->{hash}->{$lc_primary_index}->{_name} = $primary_index; # preserve case # preserve case
if ($primary_index ne $lc_primary_index) {
$self->{hash}->{$lc_primary_index}->{_name} = $primary_index;
}
}
if ($secondary_index ne $lc_secondary_index) {
# preserve case
$data->{_name} = $secondary_index;
} }
$data->{_name} = $secondary_index; # preserve case
$self->{hash}->{$lc_primary_index}->{$lc_secondary_index} = $data; $self->{hash}->{$lc_primary_index}->{$lc_secondary_index} = $data;
$self->save() unless $dont_save; $self->save() unless $dont_save;
my $name1 = $self->{hash}->{$lc_primary_index}->{_name}; my $name1 = $self->get_key_name($lc_primary_index);
my $name2 = $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{_name}; my $name2 = $self->get_key_name($lc_primary_index, $lc_secondary_index);
$name1 = 'global' if $name1 eq '.*'; $name1 = 'global' if $name1 eq '.*';
$name2 = "\"$name2\"" if $name2 =~ / /; $name2 = "\"$name2\"" if $name2 =~ / /;
$self->{pbot}->{logger}->log("$self->{name}: [$name1]: $name2 added.\n") unless $dont_save or $quiet; $self->{pbot}->{logger}->log("$self->{name}: [$name1]: $name2 added.\n") unless $dont_save or $quiet;
@ -339,7 +371,7 @@ sub remove {
if (not defined $secondary_index) { if (not defined $secondary_index) {
my $data = delete $self->{hash}->{$lc_primary_index}; my $data = delete $self->{hash}->{$lc_primary_index};
if (defined $data) { if (defined $data) {
my $name = $data->{_name}; my $name = exists $data->{_name} ? $data->{_name} : $lc_primary_index;
$name = 'global' if $name eq '.*'; $name = 'global' if $name eq '.*';
$self->save unless $dont_save; $self->save unless $dont_save;
return "$self->{name}: $name removed."; return "$self->{name}: $name removed.";
@ -348,7 +380,7 @@ sub remove {
} }
} }
my $name1 = $self->{hash}->{$lc_primary_index}->{_name}; my $name1 = $self->get_key_name($lc_primary_index);
$name1 = 'global' if $name1 eq '.*'; $name1 = 'global' if $name1 eq '.*';
if (not exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}) { if (not exists $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}) {
@ -360,11 +392,13 @@ sub remove {
if (not defined $data_index) { if (not defined $data_index) {
my $data = delete $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}; my $data = delete $self->{hash}->{$lc_primary_index}->{$lc_secondary_index};
if (defined $data) { if (defined $data) {
my $name2 = $data->{_name}; my $name2 = exists $data->{_name} ? $data->{_name} : $lc_secondary_index;
$name2 = "\"$name2\"" if $name2 =~ / /; $name2 = "\"$name2\"" if $name2 =~ / /;
# remove primary group if no more secondaries (only key left should be the _name key) # remove primary group if no more secondaries
if (keys %{$self->{hash}->{$lc_primary_index}} == 1) { delete $self->{hash}->{$lc_primary_index}; } if (grep { $_ ne '_name' } keys %{$self->{hash}->{$lc_primary_index}} == 0) {
delete $self->{hash}->{$lc_primary_index};
}
$self->save unless $dont_save; $self->save unless $dont_save;
return "$self->{name}: [$name1] $name2 removed."; return "$self->{name}: [$name1] $name2 removed.";
@ -373,9 +407,12 @@ sub remove {
} }
} }
my $name2 = $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{_name}; my $name2 = $self->get_key_name($lc_primary_index, $lc_secondary_index);
if (defined delete $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{$data_index}) { return "$self->{name}: [$name1] $name2.$data_index removed."; } if (defined delete $self->{hash}->{$lc_primary_index}->{$lc_secondary_index}->{$data_index}) {
else { return "$self->{name}: [$name1] $name2.$data_index does not exist."; } return "$self->{name}: [$name1] $name2.$data_index removed.";
} else {
return "$self->{name}: [$name1] $name2.$data_index does not exist.";
}
} }
# for compatibility with DualIndexSQLiteObject # for compatibility with DualIndexSQLiteObject

View File

@ -67,9 +67,10 @@ sub load {
# and lowercase any non-lowercased entries # and lowercase any non-lowercased entries
foreach my $index (keys %{$self->{hash}}) { foreach my $index (keys %{$self->{hash}}) {
if (not exists $self->{hash}->{$index}->{_name}) { if (not exists $self->{hash}->{$index}->{_name}) {
if (lc $index eq $index) { $self->{hash}->{$index}->{_name} = $index; } if ($index ne lc $index) {
else { if (exists $self->{hash}->{lc $index}) {
if (exists $self->{hash}->{lc $index}) { Carp::croak "Cannot update $self->{name} object $index; duplicate object found"; } Carp::croak "Cannot update $self->{name} object $index; duplicate object found";
}
my $data = delete $self->{hash}->{$index}; my $data = delete $self->{hash}->{$index};
$data->{_name} = $index; $data->{_name} = $index;
@ -140,10 +141,9 @@ sub set {
} }
if (not defined $key) { if (not defined $key) {
my $result = "[$self->{name}] $self->{hash}->{$lc_index}->{_name} keys: "; my $result = "[$self->{name}] " . $self->get_key_name($lc_index) . " keys: ";
my $comma = ''; my $comma = '';
foreach my $k (sort keys %{$self->{hash}->{$lc_index}}) { foreach my $k (sort grep { $_ ne '_name' } keys %{$self->{hash}->{$lc_index}}) {
next if $k eq '_name';
$result .= $comma . "$k => " . $self->{hash}->{$lc_index}->{$k}; $result .= $comma . "$k => " . $self->{hash}->{$lc_index}->{$k};
$comma = "; "; $comma = "; ";
} }
@ -156,7 +156,7 @@ sub set {
$self->{hash}->{$lc_index}->{$key} = $value; $self->{hash}->{$lc_index}->{$key} = $value;
$self->save unless $dont_save; $self->save unless $dont_save;
} }
return "[$self->{name}] $self->{hash}->{$lc_index}->{_name}: $key " . (defined $value ? "set to $value" : "is not set."); return "[$self->{name}] " . $self->get_key_name($lc_index) . ": $key " . (defined $value ? "set to $value" : "is not set.");
} }
sub unset { sub unset {
@ -171,9 +171,9 @@ sub unset {
if (defined delete $self->{hash}->{$lc_index}->{$key}) { if (defined delete $self->{hash}->{$lc_index}->{$key}) {
$self->save; $self->save;
return "[$self->{name}] $self->{hash}->{$lc_index}->{_name}: $key unset."; return "[$self->{name}] " . $self->get_key_name($lc_index) . ": $key unset.";
} else { } else {
return "[$self->{name}] $self->{hash}->{$lc_index}->{_name}: $key does not exist."; return "[$self->{name}] " . $self->get_key_name($lc_index) . ": $key does not exist.";
} }
} }
@ -183,6 +183,13 @@ sub exists {
return exists $self->{hash}->{lc $index}->{$data_index}; return exists $self->{hash}->{lc $index}->{$data_index};
} }
sub get_key_name {
my ($self, $index) = @_;
my $lc_index = lc $index;
return $lc_index if not exists $self->{hash}->{$lc_index};
return exists $self->{hash}->{$lc_index}->{_name} ? $self->{hash}->{$lc_index}->{_name} : $lc_index;
}
sub get_keys { sub get_keys {
my ($self, $index) = @_; my ($self, $index) = @_;
return grep { $_ ne '$metadata$' } keys %{$self->{hash}} if not defined $index; return grep { $_ ne '$metadata$' } keys %{$self->{hash}} if not defined $index;
@ -200,7 +207,12 @@ sub get_data {
sub add { sub add {
my ($self, $index, $data, $dont_save) = @_; my ($self, $index, $data, $dont_save) = @_;
my $lc_index = lc $index; my $lc_index = lc $index;
$data->{_name} = $index; # preserve case of index
# preserve case of index
if ($index ne $lc_index) {
$data->{_name} = $index;
}
$self->{hash}->{$lc_index} = $data; $self->{hash}->{$lc_index} = $data;
$self->save unless $dont_save; $self->save unless $dont_save;
return "$index added to $self->{name}."; return "$index added to $self->{name}.";
@ -220,16 +232,17 @@ sub remove {
if (defined delete $self->{hash}->{$lc_index}->{$data_index}) { if (defined delete $self->{hash}->{$lc_index}->{$data_index}) {
delete $self->{hash}->{$lc_index} if keys(%{$self->{hash}->{$lc_index}}) == 1; delete $self->{hash}->{$lc_index} if keys(%{$self->{hash}->{$lc_index}}) == 1;
$self->save unless $dont_save; $self->save unless $dont_save;
return "$self->{hash}->{$lc_index}->{_name}.$data_index removed from $self->{name}"; return $self->get_key_name($lc_index) . ".$data_index removed from $self->{name}";
} else { } else {
return "$self->{name}: $self->{hash}->{$lc_index}->{_name}.$data_index does not exist."; return "$self->{name}: " . $self->get_key_name($lc_index) . ".$data_index does not exist.";
} }
} }
my $data = delete $self->{hash}->{$lc_index}; my $data = delete $self->{hash}->{$lc_index};
if (defined $data) { if (defined $data) {
$self->save unless $dont_save; $self->save unless $dont_save;
return "$data->{_name} removed from $self->{name}."; my $name = exists $data->{_name} ? $data->{_name} : $lc_index;
return "$name removed from $self->{name}.";
} else { } else {
return "$self->{name}: $data_index does not exist."; return "$self->{name}: $data_index does not exist.";
} }

View File

@ -19,8 +19,8 @@ use LWP::UserAgent;
# These are set automatically by the misc/update_version script # These are set automatically by the misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 3507, BUILD_REVISION => 3509,
BUILD_DATE => "2020-04-21", BUILD_DATE => "2020-04-22",
}; };
sub initialize { sub initialize {

4
data/ban-exemptions vendored
View File

@ -1,10 +1,8 @@
{ {
"$metadata$" : { "$metadata$" : {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, }
"_name" : "$metadata$"
} }
} }

242
data/capabilities vendored
View File

@ -1,10 +1,8 @@
{ {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, },
"admin" : { "admin" : {
"_name" : "admin",
"can-actiontrigger" : 1, "can-actiontrigger" : 1,
"can-akalink" : 1, "can-akalink" : 1,
"can-akaunlink" : 1, "can-akaunlink" : 1,
@ -34,7 +32,6 @@
"chanop" : 1 "chanop" : 1
}, },
"botowner" : { "botowner" : {
"_name" : "botowner",
"admin" : 1, "admin" : 1,
"can-actiontrigger" : 1, "can-actiontrigger" : 1,
"can-akalink" : 1, "can-akalink" : 1,
@ -105,113 +102,47 @@
"chanop" : 1, "chanop" : 1,
"is-whitelisted" : 1 "is-whitelisted" : 1
}, },
"can-actiontrigger" : { "can-actiontrigger" : {},
"_name" : "can-actiontrigger" "can-akalink" : {},
}, "can-akaunlink" : {},
"can-akalink" : { "can-antispam" : {},
"_name" : "can-akalink"
},
"can-akaunlink" : {
"_name" : "can-akaunlink"
},
"can-antispam" : {
"_name" : "can-antispam"
},
"can-ban" : { "can-ban" : {
"_name" : "can-ban",
"can-mode-b" : 1 "can-mode-b" : 1
}, },
"can-ban-exempt" : { "can-ban-exempt" : {},
"_name" : "can-ban-exempt" "can-blacklist" : {},
}, "can-chanadd" : {},
"can-blacklist" : { "can-chanlist" : {},
"_name" : "can-blacklist" "can-chanrem" : {},
}, "can-chanset" : {},
"can-chanadd" : { "can-chanunset" : {},
"_name" : "can-chanadd" "can-clear-bans" : {},
}, "can-clear-mutes" : {},
"can-chanlist" : { "can-cmdset" : {},
"_name" : "can-chanlist" "can-cmdunset" : {},
}, "can-countertrigger" : {},
"can-chanrem" : {
"_name" : "can-chanrem"
},
"can-chanset" : {
"_name" : "can-chanset"
},
"can-chanunset" : {
"_name" : "can-chanunset"
},
"can-clear-bans" : {
"_name" : "can-clear-bans"
},
"can-clear-mutes" : {
"_name" : "can-clear-mutes"
},
"can-cmdset" : {
"_name" : "can-cmdset"
},
"can-cmdunset" : {
"_name" : "can-cmdunset"
},
"can-countertrigger" : {
"_name" : "can-countertrigger"
},
"can-deop" : { "can-deop" : {
"_name" : "can-deop",
"can-mode-o" : 1 "can-mode-o" : 1
}, },
"can-devoice" : { "can-devoice" : {
"_name" : "can-devoice",
"can-mode-v" : 1 "can-mode-v" : 1
}, },
"can-die" : { "can-die" : {},
"_name" : "can-die" "can-dumpbans" : {},
}, "can-eval" : {},
"can-dumpbans" : { "can-eventqueue" : {},
"_name" : "can-dumpbans" "can-export" : {},
}, "can-group-capabilities" : {},
"can-eval" : { "can-ignore" : {},
"_name" : "can-eval" "can-in" : {},
}, "can-invite" : {},
"can-eventqueue" : { "can-join" : {},
"_name" : "can-eventqueue" "can-kick" : {},
}, "can-kick-wildcard" : {},
"can-export" : { "can-kill" : {},
"_name" : "can-export" "can-load" : {},
}, "can-mode" : {},
"can-group-capabilities" : {
"_name" : "can-group-capabilities"
},
"can-ignore" : {
"_name" : "can-ignore"
},
"can-in" : {
"_name" : "can-in"
},
"can-invite" : {
"_name" : "can-invite"
},
"can-join" : {
"_name" : "can-join"
},
"can-kick" : {
"_name" : "can-kick"
},
"can-kick-wildcard" : {
"_name" : "can-kick-wildcard"
},
"can-kill" : {
"_name" : "can-kill"
},
"can-load" : {
"_name" : "can-load"
},
"can-mode" : {
"_name" : "can-mode"
},
"can-mode-any" : { "can-mode-any" : {
"_name" : "can-mode-any",
"can-mode" : 1, "can-mode" : 1,
"can-mode-A" : 1, "can-mode-A" : 1,
"can-mode-B" : 1, "can-mode-B" : 1,
@ -266,110 +197,53 @@
"can-mode-y" : 1, "can-mode-y" : 1,
"can-mode-z" : 1 "can-mode-z" : 1
}, },
"can-modify-admins" : { "can-modify-admins" : {},
"_name" : "can-modify-admins" "can-modify-capabilities" : {},
},
"can-modify-capabilities" : {
"_name" : "can-modify-capabilities"
},
"can-mute" : { "can-mute" : {
"_name" : "can-mute",
"can-mode-q" : 1 "can-mode-q" : 1
}, },
"can-op" : { "can-op" : {
"_name" : "can-op",
"can-mode-o" : 1 "can-mode-o" : 1
}, },
"can-op-wildcard" : { "can-op-wildcard" : {},
"_name" : "can-op-wildcard" "can-part" : {},
}, "can-plug" : {},
"can-part" : { "can-rebuildaliases" : {},
"_name" : "can-part" "can-refresh" : {},
}, "can-regchange" : {},
"can-plug" : { "can-regex" : {},
"_name" : "can-plug" "can-regset" : {},
}, "can-regsetmeta" : {},
"can-rebuildaliases" : { "can-regunset" : {},
"_name" : "can-rebuildaliases" "can-regunsetmeta" : {},
}, "can-reload" : {},
"can-refresh" : { "can-replug" : {},
"_name" : "can-refresh" "can-sl" : {},
},
"can-regchange" : {
"_name" : "can-regchange"
},
"can-regex" : {
"_name" : "can-regex"
},
"can-regset" : {
"_name" : "can-regset"
},
"can-regsetmeta" : {
"_name" : "can-regsetmeta"
},
"can-regunset" : {
"_name" : "can-regunset"
},
"can-regunsetmeta" : {
"_name" : "can-regunsetmeta"
},
"can-reload" : {
"_name" : "can-reload"
},
"can-replug" : {
"_name" : "can-replug"
},
"can-sl" : {
"_name" : "can-sl"
},
"can-unban" : { "can-unban" : {
"_name" : "can-unban",
"can-mode-b" : 1 "can-mode-b" : 1
}, },
"can-ungroup-capabilities" : { "can-ungroup-capabilities" : {},
"_name" : "can-ungroup-capabilities" "can-unignore" : {},
}, "can-unload" : {},
"can-unignore" : {
"_name" : "can-unignore"
},
"can-unload" : {
"_name" : "can-unload"
},
"can-unmute" : { "can-unmute" : {
"_name" : "can-unmute",
"can-mode-q" : 1 "can-mode-q" : 1
}, },
"can-unplug" : { "can-unplug" : {},
"_name" : "can-unplug" "can-useradd" : {},
}, "can-userdel" : {},
"can-useradd" : { "can-userset" : {},
"_name" : "can-useradd" "can-userunset" : {},
},
"can-userdel" : {
"_name" : "can-userdel"
},
"can-userset" : {
"_name" : "can-userset"
},
"can-userunset" : {
"_name" : "can-userunset"
},
"can-voice" : { "can-voice" : {
"_name" : "can-voice",
"can-mode-v" : 1 "can-mode-v" : 1
}, },
"can-voice-wildcard" : { "can-voice-wildcard" : {},
"_name" : "can-voice-wildcard"
},
"chanmod" : { "chanmod" : {
"_name" : "chanmod",
"can-devoice" : 1, "can-devoice" : 1,
"can-mod" : 1, "can-mod" : 1,
"can-voice" : 1, "can-voice" : 1,
"can-voice-wildcard" : 1 "can-voice-wildcard" : 1
}, },
"chanop" : { "chanop" : {
"_name" : "chanop",
"can-ban" : 1, "can-ban" : 1,
"can-deop" : 1, "can-deop" : 1,
"can-devoice" : 1, "can-devoice" : 1,
@ -384,8 +258,6 @@
"can-voice" : 1, "can-voice" : 1,
"is-whitelisted" : 1 "is-whitelisted" : 1
}, },
"is-whitelisted" : { "is-whitelisted" : {}
"_name" : "is-whitelisted"
}
} }

2
data/channels vendored
View File

@ -1,11 +1,9 @@
{ {
"#pbot2" : { "#pbot2" : {
"_name" : "#pbot2",
"chanop" : "0", "chanop" : "0",
"enabled" : "1" "enabled" : "1"
}, },
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
} }
} }

111
data/commands vendored
View File

@ -1,579 +1,468 @@
{ {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, },
"actiontrigger" : { "actiontrigger" : {
"_name" : "actiontrigger",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Adds a new actiontrigger to PBot. See https://github.com/pragma-/pbot/blob/master/doc/ActionTrigger.md", "help" : "Adds a new actiontrigger to PBot. See https://github.com/pragma-/pbot/blob/master/doc/ActionTrigger.md",
"requires_cap" : 1 "requires_cap" : 1
}, },
"aka" : { "aka" : {
"_name" : "aka",
"help" : "Lists known aliases for a given nick. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#aka", "help" : "Lists known aliases for a given nick. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#aka",
"requires_cap" : 0 "requires_cap" : 0
}, },
"akalink" : { "akalink" : {
"_name" : "akalink",
"help" : "Manually link a known alias to a nick. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#akalink", "help" : "Manually link a known alias to a nick. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#akalink",
"requires_cap" : 1 "requires_cap" : 1
}, },
"akaunlink" : { "akaunlink" : {
"_name" : "akaunlink",
"help" : "Manually unlink a known alias from a nick. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#akaunlink", "help" : "Manually unlink a known alias from a nick. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#akaunlink",
"requires_cap" : 1 "requires_cap" : 1
}, },
"antispam" : { "antispam" : {
"_name" : "antispam",
"help" : "See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#antispam", "help" : "See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#antispam",
"requires_cap" : 1 "requires_cap" : 1
}, },
"ban" : { "ban" : {
"_name" : "ban",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Bans a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#banmute", "help" : "Bans a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#banmute",
"requires_cap" : 1 "requires_cap" : 1
}, },
"ban-exempt" : { "ban-exempt" : {
"_name" : "ban-exempt",
"help" : "Manages list of ban-masks that are exempted from ban-evasion detection.", "help" : "Manages list of ban-masks that are exempted from ban-evasion detection.",
"requires_cap" : 1 "requires_cap" : 1
}, },
"battleship" : { "battleship" : {
"_name" : "battleship",
"help" : "The classic Battleship board game, modified for IRC. See https://github.com/pragma-/pbot/blob/master/doc/Battleship.md", "help" : "The classic Battleship board game, modified for IRC. See https://github.com/pragma-/pbot/blob/master/doc/Battleship.md",
"requires_cap" : 0 "requires_cap" : 0
}, },
"blacklist" : { "blacklist" : {
"_name" : "blacklist",
"help" : "Blacklists a hostmask from joining a channel. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#blacklist", "help" : "Blacklists a hostmask from joining a channel. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#blacklist",
"requires_cap" : 1 "requires_cap" : 1
}, },
"cap" : { "cap" : {
"_name" : "cap",
"help" : "", "help" : "",
"requires_cap" : 0 "requires_cap" : 0
}, },
"chanadd" : { "chanadd" : {
"_name" : "chanadd",
"help" : "Permanently adds a channel to PBot's list of channels to auto-join and manage. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanadd", "help" : "Permanently adds a channel to PBot's list of channels to auto-join and manage. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanadd",
"requires_cap" : 1 "requires_cap" : 1
}, },
"chanlist" : { "chanlist" : {
"_name" : "chanlist",
"help" : "Lists all added channels and their metadata keys and values. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanlist", "help" : "Lists all added channels and their metadata keys and values. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanlist",
"requires_cap" : 1 "requires_cap" : 1
}, },
"chanrem" : { "chanrem" : {
"_name" : "chanrem",
"help" : "Removes a channel from PBot's list of channels to auto-join and manage. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanrem", "help" : "Removes a channel from PBot's list of channels to auto-join and manage. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanrem",
"requires_cap" : 1 "requires_cap" : 1
}, },
"chanset" : { "chanset" : {
"_name" : "chanset",
"help" : "Sets a channel's metadata. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanset and https://github.com/pragma-/pbot/blob/master/doc/Admin.md#channel-metadata-list", "help" : "Sets a channel's metadata. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanset and https://github.com/pragma-/pbot/blob/master/doc/Admin.md#channel-metadata-list",
"requires_cap" : 1 "requires_cap" : 1
}, },
"chanunset" : { "chanunset" : {
"_name" : "chanunset",
"help" : "Deletes a channel's metadata key. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanunset", "help" : "Deletes a channel's metadata key. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#chanunset",
"requires_cap" : 1 "requires_cap" : 1
}, },
"checkban" : { "checkban" : {
"_name" : "checkban",
"help" : "Shows the reason a mask was banned and how long the ban lasts. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#checkban", "help" : "Shows the reason a mask was banned and how long the ban lasts. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#checkban",
"requires_cap" : 0 "requires_cap" : 0
}, },
"checkmute" : { "checkmute" : {
"_name" : "checkmute",
"help" : "Shows the reason a mask was muted and how long the mute lasts. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#checkmute", "help" : "Shows the reason a mask was muted and how long the mute lasts. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#checkmute",
"requires_cap" : 0 "requires_cap" : 0
}, },
"cmdset" : { "cmdset" : {
"_name" : "cmdset",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Sets or shows command metadata. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#cmdset", "help" : "Sets or shows command metadata. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#cmdset",
"requires_cap" : 1 "requires_cap" : 1
}, },
"cmdunset" : { "cmdunset" : {
"_name" : "cmdunset",
"help" : "Deletes a channel metadata key. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#cmdunset", "help" : "Deletes a channel metadata key. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#cmdunset",
"requires_cap" : 1 "requires_cap" : 1
}, },
"connect4" : { "connect4" : {
"_name" : "connect4",
"help" : "The classic Connect-4 board game. See https://github.com/pragma-/pbot/blob/master/doc/Connect4.md", "help" : "The classic Connect-4 board game. See https://github.com/pragma-/pbot/blob/master/doc/Connect4.md",
"requires_cap" : 0 "requires_cap" : 0
}, },
"count" : { "count" : {
"_name" : "count",
"help" : "Shows how many factoids and what percentage of the database <nick> has submitted. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#count", "help" : "Shows how many factoids and what percentage of the database <nick> has submitted. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#count",
"requires_cap" : 0 "requires_cap" : 0
}, },
"counteradd" : { "counteradd" : {
"_name" : "counteradd",
"help" : "Adds a new counter. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#add", "help" : "Adds a new counter. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#add",
"requires_cap" : 0 "requires_cap" : 0
}, },
"counterdel" : { "counterdel" : {
"_name" : "counterdel",
"help" : "Deletes a counter. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#del", "help" : "Deletes a counter. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#del",
"requires_cap" : 0 "requires_cap" : 0
}, },
"counterlist" : { "counterlist" : {
"_name" : "counterlist",
"help" : "Lists counters. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#list", "help" : "Lists counters. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#list",
"requires_cap" : 0 "requires_cap" : 0
}, },
"counterreset" : { "counterreset" : {
"_name" : "counterreset",
"help" : "Resets a counter. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#reset", "help" : "Resets a counter. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#reset",
"requires_cap" : 0 "requires_cap" : 0
}, },
"countershow" : { "countershow" : {
"_name" : "countershow",
"help" : "Shows a counter's data. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#show", "help" : "Shows a counter's data. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#show",
"requires_cap" : 0 "requires_cap" : 0
}, },
"countertrigger" : { "countertrigger" : {
"_name" : "countertrigger",
"help" : "Manages counter triggers. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#trigger", "help" : "Manages counter triggers. See https://github.com/pragma-/pbot/blob/master/doc/Counter.md#trigger",
"requires_cap" : 1 "requires_cap" : 1
}, },
"date" : { "date" : {
"_name" : "date",
"help" : "Shows date and time for a timezone. Accepts Linux timezone locations. You can set `!my timezone ...` to remember your timezone.", "help" : "Shows date and time for a timezone. Accepts Linux timezone locations. You can set `!my timezone ...` to remember your timezone.",
"requires_cap" : 0 "requires_cap" : 0
}, },
"delq" : { "delq" : {
"_name" : "delq",
"help" : "Deletes a quote from the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#delq", "help" : "Deletes a quote from the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#delq",
"requires_cap" : 0 "requires_cap" : 0
}, },
"deop" : { "deop" : {
"_name" : "deop",
"help" : "Removes OP status from users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#deop", "help" : "Removes OP status from users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#deop",
"requires_cap" : 1 "requires_cap" : 1
}, },
"devoice" : { "devoice" : {
"_name" : "devoice",
"help" : "Removes VOICE status from users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#devoice", "help" : "Removes VOICE status from users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#devoice",
"requires_cap" : 1 "requires_cap" : 1
}, },
"die" : { "die" : {
"_name" : "die",
"help" : "Tells PBot to disconnect and exit. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#die", "help" : "Tells PBot to disconnect and exit. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#die",
"requires_cap" : 1 "requires_cap" : 1
}, },
"dumpbans" : { "dumpbans" : {
"_name" : "dumpbans",
"help" : "Displays PBot's internal banlist data structure. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#dumpbans", "help" : "Displays PBot's internal banlist data structure. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#dumpbans",
"requires_cap" : 1 "requires_cap" : 1
}, },
"eval" : { "eval" : {
"_name" : "eval",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Evaluates Perl code within PBot's context. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#eval", "help" : "Evaluates Perl code within PBot's context. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#eval",
"requires_cap" : 1 "requires_cap" : 1
}, },
"export" : { "export" : {
"_name" : "export",
"background-process" : "1", "background-process" : "1",
"help" : "Exports specified list to HTML file. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#export", "help" : "Exports specified list to HTML file. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#export",
"requires_cap" : 1 "requires_cap" : 1
}, },
"fact" : { "fact" : {
"_name" : "fact",
"help" : "Displays or invokes a factoid belonging to a specific channel. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#fact", "help" : "Displays or invokes a factoid belonging to a specific channel. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#fact",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factadd" : { "factadd" : {
"_name" : "factadd",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Creates a new factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factadd", "help" : "Creates a new factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factadd",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factalias" : { "factalias" : {
"_name" : "factalias",
"help" : "Creates a factoid that acts as an alias for a command. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factalias", "help" : "Creates a factoid that acts as an alias for a command. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factalias",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factchange" : { "factchange" : {
"_name" : "factchange",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Changes a factoid using a regular expression. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factchange", "help" : "Changes a factoid using a regular expression. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factchange",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factfind" : { "factfind" : {
"_name" : "factfind",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Searches the database for a factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factfind", "help" : "Searches the database for a factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factfind",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factinfo" : { "factinfo" : {
"_name" : "factinfo",
"help" : "Displays information about a factoid, such as who submitted it and when. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factinfo", "help" : "Displays information about a factoid, such as who submitted it and when. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factinfo",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factlog" : { "factlog" : {
"_name" : "factlog",
"help" : "Displays a factoid's changelog history. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factlog", "help" : "Displays a factoid's changelog history. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factlog",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factmove" : { "factmove" : {
"_name" : "factmove",
"help" : "Renames a factoid or moves a factoid to a different channel. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factmove", "help" : "Renames a factoid or moves a factoid to a different channel. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factmove",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factredo" : { "factredo" : {
"_name" : "factredo",
"help" : "Reverts a factoid to a newer revision. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factredo", "help" : "Reverts a factoid to a newer revision. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factredo",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factrem" : { "factrem" : {
"_name" : "factrem",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Deletes a factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factrem", "help" : "Deletes a factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factrem",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factset" : { "factset" : {
"_name" : "factset",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Displays or sets factoid metadata, such as owner, rate-limit, etc. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factset and https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factoid-metadata-list", "help" : "Displays or sets factoid metadata, such as owner, rate-limit, etc. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factset and https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factoid-metadata-list",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factshow" : { "factshow" : {
"_name" : "factshow",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Displays a factoid's literal value without invoking the factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factshow", "help" : "Displays a factoid's literal value without invoking the factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factshow",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factundo" : { "factundo" : {
"_name" : "factundo",
"help" : "Reverts a factoid to an older revision. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factundo", "help" : "Reverts a factoid to an older revision. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factundo",
"requires_cap" : 0 "requires_cap" : 0
}, },
"factunset" : { "factunset" : {
"_name" : "factunset",
"help" : "Unsets a factoid metadata key. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factunset and https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factoid-metadata-list", "help" : "Unsets a factoid metadata key. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factunset and https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factoid-metadata-list",
"requires_cap" : 0 "requires_cap" : 0
}, },
"forget" : { "forget" : {
"_name" : "forget",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Deletes a factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#forget", "help" : "Deletes a factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#forget",
"requires_cap" : 0 "requires_cap" : 0
}, },
"func" : { "func" : {
"_name" : "func",
"help" : "Invokes built-in functions. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#func", "help" : "Invokes built-in functions. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#func",
"requires_cap" : 0 "requires_cap" : 0
}, },
"getq" : { "getq" : {
"_name" : "getq",
"help" : "Retrieves and displays a specific quote from the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#getq", "help" : "Retrieves and displays a specific quote from the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#getq",
"requires_cap" : 0 "requires_cap" : 0
}, },
"google" : { "google" : {
"_name" : "google",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Displays Google search results for a query. See https://github.com/pragma-/pbot/blob/master/doc/Modules.md#google", "help" : "Displays Google search results for a query. See https://github.com/pragma-/pbot/blob/master/doc/Modules.md#google",
"requires_cap" : 0 "requires_cap" : 0
}, },
"grab" : { "grab" : {
"_name" : "grab",
"help" : "Grabs a message someone says, and adds it to the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#grab", "help" : "Grabs a message someone says, and adds it to the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#grab",
"requires_cap" : 0 "requires_cap" : 0
}, },
"help" : { "help" : {
"_name" : "help",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Displays the `help` metadata for commands and factoids.", "help" : "Displays the `help` metadata for commands and factoids.",
"requires_cap" : 0 "requires_cap" : 0
}, },
"histogram" : { "histogram" : {
"_name" : "histogram",
"help" : "Displays a histogram of the top factoid submitters. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#histogram", "help" : "Displays a histogram of the top factoid submitters. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#histogram",
"requires_cap" : 0 "requires_cap" : 0
}, },
"ignore" : { "ignore" : {
"_name" : "ignore",
"help" : "Ignores a user. If you omit [channel] PBot will ignore the user in all channels, including private messages. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#ignore", "help" : "Ignores a user. If you omit [channel] PBot will ignore the user in all channels, including private messages. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#ignore",
"requires_cap" : 1 "requires_cap" : 1
}, },
"in" : { "in" : {
"_name" : "in",
"help" : "Performs a command in a specific channel. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#in", "help" : "Performs a command in a specific channel. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#in",
"requires_cap" : 1 "requires_cap" : 1
}, },
"invite" : { "invite" : {
"_name" : "invite",
"help" : "Invites a user to a channel. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#invite", "help" : "Invites a user to a channel. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#invite",
"requires_cap" : 1 "requires_cap" : 1
}, },
"join" : { "join" : {
"_name" : "join",
"help" : "Temporarily joins a channel without adding it to PBot's list of channels to manage/auto-join. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#join", "help" : "Temporarily joins a channel without adding it to PBot's list of channels to manage/auto-join. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#join",
"requires_cap" : 1 "requires_cap" : 1
}, },
"kick" : { "kick" : {
"_name" : "kick",
"help" : "Removes a user from the channel. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#kick", "help" : "Removes a user from the channel. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#kick",
"requires_cap" : 1 "requires_cap" : 1
}, },
"lagcheck" : { "lagcheck" : {
"_name" : "lagcheck",
"help" : "Displays history of PING times. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#lagcheck", "help" : "Displays history of PING times. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#lagcheck",
"requires_cap" : 0 "requires_cap" : 0
}, },
"learn" : { "learn" : {
"_name" : "learn",
"help" : "Creates a new factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factadd", "help" : "Creates a new factoid. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#factadd",
"requires_cap" : 0 "requires_cap" : 0
}, },
"list" : { "list" : {
"_name" : "list",
"help" : "Lists various collections, such as channels or admins. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#list" "help" : "Lists various collections, such as channels or admins. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#list"
}, },
"load" : { "load" : {
"_name" : "load",
"help" : "This command loads a module as a PBot command. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#load", "help" : "This command loads a module as a PBot command. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#load",
"requires_cap" : 1 "requires_cap" : 1
}, },
"login" : { "login" : {
"_name" : "login",
"help" : "Logs into a PBot admin account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#login", "help" : "Logs into a PBot admin account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#login",
"requires_cap" : 0 "requires_cap" : 0
}, },
"logout" : { "logout" : {
"_name" : "logout",
"help" : "Logs out of a PBot admin account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#logout", "help" : "Logs out of a PBot admin account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#logout",
"requires_cap" : 0 "requires_cap" : 0
}, },
"mod" : { "mod" : {
"_name" : "mod",
"help" : "Provides restricted moderation abilities to voiced users. They can kick/ban/etc only users that are not admins, whitelisted, voiced or opped.", "help" : "Provides restricted moderation abilities to voiced users. They can kick/ban/etc only users that are not admins, whitelisted, voiced or opped.",
"requires_cap" : 0 "requires_cap" : 0
}, },
"mode" : { "mode" : {
"_name" : "mode",
"help" : "Sets or unsets channel or user modes. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#mode", "help" : "Sets or unsets channel or user modes. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#mode",
"requires_cap" : 1 "requires_cap" : 1
}, },
"mute" : { "mute" : {
"_name" : "mute",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Mutes a user. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#banmute", "help" : "Mutes a user. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#banmute",
"requires_cap" : 1 "requires_cap" : 1
}, },
"my" : { "my" : {
"_name" : "my",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Lets users view and manipulate their own user metadata. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#my and https://github.com/pragma-/pbot/blob/master/doc/Admin.md#user-metadata-list", "help" : "Lets users view and manipulate their own user metadata. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#my and https://github.com/pragma-/pbot/blob/master/doc/Admin.md#user-metadata-list",
"requires_cap" : "0" "requires_cap" : "0"
}, },
"nicklist" : { "nicklist" : {
"_name" : "nicklist",
"help" : "Dumps the internal nicklist structure. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#nicklist", "help" : "Dumps the internal nicklist structure. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#nicklist",
"requires_cap" : 0 "requires_cap" : 0
}, },
"op" : { "op" : {
"_name" : "op",
"help" : "Gives channel operator status to users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#op", "help" : "Gives channel operator status to users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#op",
"requires_cap" : "1" "requires_cap" : "1"
}, },
"part" : { "part" : {
"_name" : "part",
"help" : "Departs a channel, without removing it from PBot's list of channels to manage/auto-join. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#part", "help" : "Departs a channel, without removing it from PBot's list of channels to manage/auto-join. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#part",
"requires_cap" : 1 "requires_cap" : 1
}, },
"plug" : { "plug" : {
"_name" : "plug",
"help" : "Loads a plugin into PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#plug", "help" : "Loads a plugin into PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#plug",
"requires_cap" : 1 "requires_cap" : 1
}, },
"pluglist" : { "pluglist" : {
"_name" : "pluglist",
"help" : "Lists all currently loaded plugins. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#pluglist", "help" : "Lists all currently loaded plugins. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#pluglist",
"requires_cap" : 0 "requires_cap" : 0
}, },
"rebuildaliases" : { "rebuildaliases" : {
"_name" : "rebuildaliases",
"help" : "Rebuilds the aka link table. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#rebuildaliases", "help" : "Rebuilds the aka link table. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#rebuildaliases",
"requires_cap" : 1 "requires_cap" : 1
}, },
"recall" : { "recall" : {
"_name" : "recall",
"background-process" : "1", "background-process" : "1",
"help" : "Recalls previous chat history for a channel. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#recall", "help" : "Recalls previous chat history for a channel. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#recall",
"requires_cap" : 0 "requires_cap" : 0
}, },
"refresh" : { "refresh" : {
"_name" : "refresh",
"help" : "Refreshes and reloads PBot core modules and plugins. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#refresh", "help" : "Refreshes and reloads PBot core modules and plugins. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#refresh",
"requires_cap" : 0 "requires_cap" : 0
}, },
"regchange" : { "regchange" : {
"_name" : "regchange",
"help" : "Changes the value of a registry item using a regular expression. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regchange", "help" : "Changes the value of a registry item using a regular expression. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regchange",
"requires_cap" : 1 "requires_cap" : 1
}, },
"regex" : { "regex" : {
"_name" : "regex",
"help" : "Manages regular expression commands. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#regex", "help" : "Manages regular expression commands. See https://github.com/pragma-/pbot/blob/master/doc/Commands.md#regex",
"requires_cap" : 1 "requires_cap" : 1
}, },
"regfind" : { "regfind" : {
"_name" : "regfind",
"help" : "Searches the registry for keywords or values. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regfind", "help" : "Searches the registry for keywords or values. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regfind",
"requires_cap" : 0 "requires_cap" : 0
}, },
"regset" : { "regset" : {
"_name" : "regset",
"help" : "Creates a new registry item or updates an existing item. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regset", "help" : "Creates a new registry item or updates an existing item. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regset",
"requires_cap" : 1 "requires_cap" : 1
}, },
"regsetmeta" : { "regsetmeta" : {
"_name" : "regsetmeta",
"help" : "Sets or displays the metadata for a specific registry key. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regsetmeta and https://github.com/pragma-/pbot/blob/master/doc/Registry.md#metadata-list", "help" : "Sets or displays the metadata for a specific registry key. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regsetmeta and https://github.com/pragma-/pbot/blob/master/doc/Registry.md#metadata-list",
"requires_cap" : 1 "requires_cap" : 1
}, },
"regshow" : { "regshow" : {
"_name" : "regshow",
"help" : "Displays the type and value of a registry item. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regshow", "help" : "Displays the type and value of a registry item. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regshow",
"requires_cap" : 0 "requires_cap" : 0
}, },
"regunset" : { "regunset" : {
"_name" : "regunset",
"help" : "Deletes a registry item from a specific section/channel. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regunset", "help" : "Deletes a registry item from a specific section/channel. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regunset",
"requires_cap" : 1 "requires_cap" : 1
}, },
"regunsetmeta" : { "regunsetmeta" : {
"_name" : "regunsetmeta",
"help" : "Deletes a metadata key from a registry item. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regsetmeta and https://github.com/pragma-/pbot/blob/master/doc/Registry.md#metadata", "help" : "Deletes a metadata key from a registry item. See https://github.com/pragma-/pbot/blob/master/doc/Registry.md#regsetmeta and https://github.com/pragma-/pbot/blob/master/doc/Registry.md#metadata",
"requires_cap" : 1 "requires_cap" : 1
}, },
"reload" : { "reload" : {
"_name" : "reload",
"help" : "Reloads a data or configuration file. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#reload", "help" : "Reloads a data or configuration file. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#reload",
"requires_cap" : 1 "requires_cap" : 1
}, },
"remindme" : { "remindme" : {
"_name" : "remindme",
"help" : "Manages user reminders. See https://github.com/pragma-/pbot/blob/master/doc/Remindme.md", "help" : "Manages user reminders. See https://github.com/pragma-/pbot/blob/master/doc/Remindme.md",
"requires_cap" : 0 "requires_cap" : 0
}, },
"replug" : { "replug" : {
"_name" : "replug",
"help" : "Reloads a plugin into PBot. The plugin is first unloaded and then it is loaded again. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#replug", "help" : "Reloads a plugin into PBot. The plugin is first unloaded and then it is loaded again. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#replug",
"requires_cap" : 1 "requires_cap" : 1
}, },
"rq" : { "rq" : {
"_name" : "rq",
"help" : "Retrieves and displays a random quote from the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#rq", "help" : "Retrieves and displays a random quote from the quotegrabs database. See https://github.com/pragma-/pbot/blob/master/doc/Quotegrabs.md#rq",
"requires_cap" : 0 "requires_cap" : 0
}, },
"sl" : { "sl" : {
"_name" : "sl",
"help" : "Sends a raw IRC command to the server. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#sl", "help" : "Sends a raw IRC command to the server. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#sl",
"requires_cap" : 1 "requires_cap" : 1
}, },
"spinach" : { "spinach" : {
"_name" : "spinach",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Manages and interacts with the Spinach trivia game. See https://github.com/pragma-/pbot/blob/master/doc/Spinach.md", "help" : "Manages and interacts with the Spinach trivia game. See https://github.com/pragma-/pbot/blob/master/doc/Spinach.md",
"requires_cap" : 0 "requires_cap" : 0
}, },
"top20" : { "top20" : {
"_name" : "top20",
"help" : "Displays the top 20 most popular factoids. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#top20", "help" : "Displays the top 20 most popular factoids. See https://github.com/pragma-/pbot/blob/master/doc/Factoids.md#top20",
"requires_cap" : 0 "requires_cap" : 0
}, },
"unban" : { "unban" : {
"_name" : "unban",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Unbans a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unbanunmute", "help" : "Unbans a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unbanunmute",
"requires_cap" : 1 "requires_cap" : 1
}, },
"unbanme" : { "unbanme" : {
"_name" : "unbanme",
"help" : "Removes a join-flood ban. See https://github.com/pragma-/pbot/blob/master/doc/Abuse.md#unbanme", "help" : "Removes a join-flood ban. See https://github.com/pragma-/pbot/blob/master/doc/Abuse.md#unbanme",
"requires_cap" : 0 "requires_cap" : 0
}, },
"unignore" : { "unignore" : {
"_name" : "unignore",
"help" : "Unignores a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unignore", "help" : "Unignores a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unignore",
"requires_cap" : 1 "requires_cap" : 1
}, },
"unload" : { "unload" : {
"_name" : "unload",
"help" : "Unloads a module and removes its associated command. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unload", "help" : "Unloads a module and removes its associated command. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unload",
"requires_cap" : 1 "requires_cap" : 1
}, },
"unmute" : { "unmute" : {
"_name" : "unmute",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Unmutes a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unbanunmute", "help" : "Unmutes a user. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unbanunmute",
"requires_cap" : 1 "requires_cap" : 1
}, },
"unplug" : { "unplug" : {
"_name" : "unplug",
"help" : "Unloads a plugin from PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unplug", "help" : "Unloads a plugin from PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#unplug",
"requires_cap" : 1 "requires_cap" : 1
}, },
"uptime" : { "uptime" : {
"_name" : "uptime",
"help" : "Displays the date and time this instance of PBot was started and how long it has been running.", "help" : "Displays the date and time this instance of PBot was started and how long it has been running.",
"requires_cap" : 0 "requires_cap" : 0
}, },
"useradd" : { "useradd" : {
"_name" : "useradd",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Adds a new user to PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#useradd", "help" : "Adds a new user to PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#useradd",
"requires_cap" : 1 "requires_cap" : 1
}, },
"userdel" : { "userdel" : {
"_name" : "userdel",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Removes an user from PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#userdel", "help" : "Removes an user from PBot. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#userdel",
"requires_cap" : 1 "requires_cap" : 1
}, },
"users" : { "users" : {
"_name" : "users",
"help" : "", "help" : "",
"requires_cap" : 0 "requires_cap" : 0
}, },
"userset" : { "userset" : {
"_name" : "userset",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Sets metadata for an user account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#userset and https://github.com/pragma-/pbot/blob/master/doc/Admin.md#user-metadata-list", "help" : "Sets metadata for an user account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#userset and https://github.com/pragma-/pbot/blob/master/doc/Admin.md#user-metadata-list",
"requires_cap" : 1 "requires_cap" : 1
}, },
"userunset" : { "userunset" : {
"_name" : "userunset",
"dont-replace-pronouns" : "1", "dont-replace-pronouns" : "1",
"help" : "Deletes a metadata key from an user account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#userunset", "help" : "Deletes a metadata key from an user account. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#userunset",
"requires_cap" : 1 "requires_cap" : 1
}, },
"version" : { "version" : {
"_name" : "version",
"help" : "", "help" : "",
"requires_cap" : 0 "requires_cap" : 0
}, },
"voice" : { "voice" : {
"_name" : "voice",
"help" : "Sets mode +v on users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#voice", "help" : "Sets mode +v on users. Accepts wildcards. See https://github.com/pragma-/pbot/blob/master/doc/Admin.md#voice",
"requires_cap" : 1 "requires_cap" : 1
}, },
"weather" : { "weather" : {
"_name" : "weather",
"background-process" : "1", "background-process" : "1",
"help" : "Fetches and displays weather data. You may set `!my location ...` to remember your location.", "help" : "Fetches and displays weather data. You may set `!my location ...` to remember your location.",
"requires_cap" : 0 "requires_cap" : 0
}, },
"wttr" : { "wttr" : {
"_name" : "wttr",
"background-process" : "1", "background-process" : "1",
"help" : "", "help" : "",
"requires_cap" : "0" "requires_cap" : "0"

4
data/ignorelist vendored
View File

@ -1,10 +1,8 @@
{ {
"$metadata$" : { "$metadata$" : {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, }
"_name" : "$metadata$"
} }
} }

2
data/last_update vendored
View File

@ -1 +1 @@
3507 3509

109
data/registry vendored
View File

@ -1,189 +1,148 @@
{ {
"$metadata$" : { "$metadata$" : {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, }
"_name" : "$metadata$"
}, },
"antiaway" : { "antiaway" : {
"_name" : "antiaway",
"bad_actions" : { "bad_actions" : {
"_name" : "bad_actions",
"type" : "text", "type" : "text",
"value" : "^/me (is (away|gone)|.*auto.?away)" "value" : "^/me (is (away|gone)|.*auto.?away)"
}, },
"bad_nicks" : { "bad_nicks" : {
"_name" : "bad_nicks",
"type" : "text", "type" : "text",
"value" : "(^z+[[:punct:]]|[[:punct:]](afk|brb|bbl|away|sleep|asleep|nap|z+|work|gone|study|out|home|busy|off)[[:punct:]]*$|afk$)" "value" : "(^z+[[:punct:]]|[[:punct:]](afk|brb|bbl|away|sleep|asleep|nap|z+|work|gone|study|out|home|busy|off)[[:punct:]]*$|afk$)"
}, },
"kick_msg" : { "kick_msg" : {
"_name" : "kick_msg",
"type" : "text", "type" : "text",
"value" : "http://sackheads.org/~bnaylor/spew/away_msgs.html" "value" : "http://sackheads.org/~bnaylor/spew/away_msgs.html"
} }
}, },
"antiflood" : { "antiflood" : {
"_name" : "antiflood",
"antirepeat" : { "antirepeat" : {
"_name" : "antirepeat",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"antirepeat_allow_bot" : { "antirepeat_allow_bot" : {
"_name" : "antirepeat_allow_bot",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"antirepeat_match" : { "antirepeat_match" : {
"_name" : "antirepeat_match",
"type" : "text", "type" : "text",
"value" : "0.5" "value" : "0.5"
}, },
"antirepeat_threshold" : { "antirepeat_threshold" : {
"_name" : "antirepeat_threshold",
"type" : "text", "type" : "text",
"value" : "2.5" "value" : "2.5"
}, },
"chat_flood_punishment" : { "chat_flood_punishment" : {
"_name" : "chat_flood_punishment",
"type" : "array", "type" : "array",
"value" : "60,300,3600,86400,604800,2419200" "value" : "60,300,3600,86400,604800,2419200"
}, },
"chat_flood_threshold" : { "chat_flood_threshold" : {
"_name" : "chat_flood_threshold",
"type" : "text", "type" : "text",
"value" : "4" "value" : "4"
}, },
"chat_flood_time_threshold" : { "chat_flood_time_threshold" : {
"_name" : "chat_flood_time_threshold",
"type" : "text", "type" : "text",
"value" : "5" "value" : "5"
}, },
"debug_checkban" : { "debug_checkban" : {
"_name" : "debug_checkban",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"dont_enforce_admins" : { "dont_enforce_admins" : {
"_name" : "dont_enforce_admins",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"enforce" : { "enforce" : {
"_name" : "enforce",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"enter_abuse_max_offenses" : { "enter_abuse_max_offenses" : {
"_name" : "enter_abuse_max_offenses",
"type" : "text", "type" : "text",
"value" : "3" "value" : "3"
}, },
"enter_abuse_punishment" : { "enter_abuse_punishment" : {
"_name" : "enter_abuse_punishment",
"type" : "array", "type" : "array",
"value" : "60,300,3600,86400,604800,2419200" "value" : "60,300,3600,86400,604800,2419200"
}, },
"enter_abuse_threshold" : { "enter_abuse_threshold" : {
"_name" : "enter_abuse_threshold",
"type" : "text", "type" : "text",
"value" : "4" "value" : "4"
}, },
"enter_abuse_time_threshold" : { "enter_abuse_time_threshold" : {
"_name" : "enter_abuse_time_threshold",
"type" : "text", "type" : "text",
"value" : "15" "value" : "15"
}, },
"join_flood_punishment" : { "join_flood_punishment" : {
"_name" : "join_flood_punishment",
"type" : "array", "type" : "array",
"value" : "115200,3600,10800,604800" "value" : "115200,3600,10800,604800"
}, },
"join_flood_threshold" : { "join_flood_threshold" : {
"_name" : "join_flood_threshold",
"type" : "text", "type" : "text",
"value" : "4" "value" : "4"
}, },
"join_flood_time_threshold" : { "join_flood_time_threshold" : {
"_name" : "join_flood_time_threshold",
"type" : "text", "type" : "text",
"value" : "1800" "value" : "1800"
}, },
"nick_flood_punishment" : { "nick_flood_punishment" : {
"_name" : "nick_flood_punishment",
"type" : "array", "type" : "array",
"value" : "1800,3600,86400,604800" "value" : "1800,3600,86400,604800"
}, },
"nick_flood_threshold" : { "nick_flood_threshold" : {
"_name" : "nick_flood_threshold",
"type" : "text", "type" : "text",
"value" : "3" "value" : "3"
}, },
"nick_flood_time_threshold" : { "nick_flood_time_threshold" : {
"_name" : "nick_flood_time_threshold",
"type" : "text", "type" : "text",
"value" : "1800" "value" : "1800"
} }
}, },
"antikickautorejoin" : { "antikickautorejoin" : {
"_name" : "antikickautorejoin",
"punishment" : { "punishment" : {
"_name" : "punishment",
"type" : "array", "type" : "array",
"value" : "300,900,1800,3600,28800" "value" : "300,900,1800,3600,28800"
}, },
"threshold" : { "threshold" : {
"_name" : "threshold",
"type" : "text", "type" : "text",
"value" : "4" "value" : "4"
} }
}, },
"antispam" : { "antispam" : {
"_name" : "antispam",
"enforce" : { "enforce" : {
"_name" : "enforce",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
} }
}, },
"autorejoin" : { "autorejoin" : {
"_name" : "autorejoin",
"rejoin_delay" : { "rejoin_delay" : {
"_name" : "rejoin_delay",
"type" : "array", "type" : "array",
"value" : "900,1800,3600" "value" : "900,1800,3600"
} }
}, },
"bantracker" : { "bantracker" : {
"_name" : "bantracker",
"chanserv_ban_timeout" : { "chanserv_ban_timeout" : {
"_name" : "chanserv_ban_timeout",
"type" : "text", "type" : "text",
"value" : "604800" "value" : "604800"
}, },
"debug" : { "debug" : {
"_name" : "debug",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"mute_timeout" : { "mute_timeout" : {
"_name" : "mute_timeout",
"type" : "text", "type" : "text",
"value" : "604800" "value" : "604800"
} }
}, },
"date" : { "date" : {
"_name" : "date",
"default_timezone" : { "default_timezone" : {
"_name" : "default_timezone",
"type" : "text", "type" : "text",
"value" : "UTC" "value" : "UTC"
} }
}, },
"dualindexsqliteobject" : { "dualindexsqliteobject" : {
"_name" : "dualindexsqliteobject",
"debug_factoids" : { "debug_factoids" : {
"_name" : "debug_Factoids", "_name" : "debug_Factoids",
"type" : "text", "type" : "text",
@ -191,306 +150,242 @@
} }
}, },
"factoids" : { "factoids" : {
"_name" : "factoids",
"default_rate_limit" : { "default_rate_limit" : {
"_name" : "default_rate_limit",
"type" : "text", "type" : "text",
"value" : "15" "value" : "15"
}, },
"max_channel_length" : { "max_channel_length" : {
"_name" : "max_channel_length",
"type" : "text", "type" : "text",
"value" : "20" "value" : "20"
}, },
"max_content_length" : { "max_content_length" : {
"_name" : "max_content_length",
"type" : "text", "type" : "text",
"value" : "8192" "value" : "8192"
}, },
"max_name_length" : { "max_name_length" : {
"_name" : "max_name_length",
"type" : "text", "type" : "text",
"value" : "100" "value" : "100"
} }
}, },
"general" : { "general" : {
"_name" : "general",
"autojoin_wait_for_nickserv" : { "autojoin_wait_for_nickserv" : {
"_name" : "autojoin_wait_for_nickserv",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"compile_blocks" : { "compile_blocks" : {
"_name" : "compile_blocks",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"compile_blocks_channels" : { "compile_blocks_channels" : {
"_name" : "compile_blocks_channels",
"type" : "array", "type" : "array",
"value" : ".*" "value" : ".*"
}, },
"compile_blocks_ignore_channels" : { "compile_blocks_ignore_channels" : {
"_name" : "compile_blocks_ignore_channels",
"type" : "array", "type" : "array",
"value" : "none" "value" : "none"
}, },
"data_dir" : { "data_dir" : {
"_name" : "data_dir",
"type" : "text", "type" : "text",
"value" : "data" "value" : "data"
}, },
"debugcontext" : { "debugcontext" : {
"_name" : "debugcontext",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"deop_timeout" : { "deop_timeout" : {
"_name" : "deop_timeout",
"type" : "text", "type" : "text",
"value" : "300" "value" : "300"
}, },
"identify_command" : { "identify_command" : {
"_name" : "identify_command",
"type" : "text", "type" : "text",
"value" : "identify $nick $password" "value" : "identify $nick $password"
}, },
"identify_nick" : { "identify_nick" : {
"_name" : "identify_nick",
"type" : "text", "type" : "text",
"value" : "nickserv" "value" : "nickserv"
}, },
"module_dir" : { "module_dir" : {
"_name" : "module_dir",
"type" : "text", "type" : "text",
"value" : "./modules" "value" : "./modules"
}, },
"module_repo" : { "module_repo" : {
"_name" : "module_repo",
"type" : "text", "type" : "text",
"value" : "https://github.com/pragma-/pbot/blob/master/modules/" "value" : "https://github.com/pragma-/pbot/blob/master/modules/"
}, },
"module_timeout" : { "module_timeout" : {
"_name" : "module_timeout",
"type" : "text", "type" : "text",
"value" : "30" "value" : "30"
}, },
"op_command" : { "op_command" : {
"_name" : "op_command",
"type" : "text", "type" : "text",
"value" : "op $channel" "value" : "op $channel"
}, },
"op_nick" : { "op_nick" : {
"_name" : "op_nick",
"type" : "text", "type" : "text",
"value" : "chanserv" "value" : "chanserv"
}, },
"plugin_dir" : { "plugin_dir" : {
"_name" : "plugin_dir",
"type" : "text", "type" : "text",
"value" : "./Plugins" "value" : "./Plugins"
}, },
"show_url_titles" : { "show_url_titles" : {
"_name" : "show_url_titles",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"show_url_titles_channels" : { "show_url_titles_channels" : {
"_name" : "show_url_titles_channels",
"type" : "array", "type" : "array",
"value" : ".*" "value" : ".*"
}, },
"show_url_titles_ignore_channels" : { "show_url_titles_ignore_channels" : {
"_name" : "show_url_titles_ignore_channels",
"type" : "array", "type" : "array",
"value" : "none" "value" : "none"
}, },
"strictnamespace" : { "strictnamespace" : {
"_name" : "strictnamespace",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"trigger" : { "trigger" : {
"_name" : "trigger",
"type" : "text", "type" : "text",
"value" : "[!]" "value" : "[!]"
} }
}, },
"googlesearch" : { "googlesearch" : {
"_name" : "googlesearch",
"api_key" : { "api_key" : {
"_name" : "api_key",
"private" : "1", "private" : "1",
"type" : "text", "type" : "text",
"value" : "" "value" : ""
}, },
"context" : { "context" : {
"_name" : "context",
"private" : "1", "private" : "1",
"type" : "text", "type" : "text",
"value" : "" "value" : ""
} }
}, },
"interpreter" : { "interpreter" : {
"_name" : "interpreter",
"max_recursion" : { "max_recursion" : {
"_name" : "max_recursion",
"type" : "text", "type" : "text",
"value" : "100" "value" : "100"
} }
}, },
"irc" : { "irc" : {
"_name" : "irc",
"botnick" : { "botnick" : {
"_name" : "botnick",
"type" : "text", "type" : "text",
"value" : "" "value" : "wtfsadfff"
}, },
"debug" : { "debug" : {
"_name" : "debug",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"identify_password" : { "identify_password" : {
"_name" : "identify_password",
"private" : "1", "private" : "1",
"type" : "text", "type" : "text",
"value" : "" "value" : ""
}, },
"log_default_handler" : { "log_default_handler" : {
"_name" : "log_default_handler",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"max_msg_len" : { "max_msg_len" : {
"_name" : "max_msg_len",
"type" : "text", "type" : "text",
"value" : "425" "value" : "425"
}, },
"port" : { "port" : {
"_name" : "port",
"type" : "text", "type" : "text",
"value" : "6667" "value" : "6667"
}, },
"randomize_nick" : { "randomize_nick" : {
"_name" : "randomize_nick",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"realname" : { "realname" : {
"_name" : "realname",
"type" : "text", "type" : "text",
"value" : "https://github.com/pragma-/pbot" "value" : "https://github.com/pragma-/pbot"
}, },
"server" : { "server" : {
"_name" : "server",
"type" : "text", "type" : "text",
"value" : "irc.freenode.net" "value" : "irc.freenode.net"
}, },
"show_motd" : { "show_motd" : {
"_name" : "show_motd",
"type" : "text", "type" : "text",
"value" : "1" "value" : "1"
}, },
"ssl" : { "ssl" : {
"_name" : "ssl",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"ssl_ca_file" : { "ssl_ca_file" : {
"_name" : "ssl_ca_file",
"private" : "1", "private" : "1",
"type" : "text", "type" : "text",
"value" : "none" "value" : "none"
}, },
"ssl_ca_path" : { "ssl_ca_path" : {
"_name" : "ssl_ca_path",
"private" : "1", "private" : "1",
"type" : "text", "type" : "text",
"value" : "none" "value" : "none"
}, },
"username" : { "username" : {
"_name" : "username",
"type" : "text", "type" : "text",
"value" : "pbot3" "value" : "pbot3"
} }
}, },
"lagchecker" : { "lagchecker" : {
"_name" : "lagchecker",
"lag_history_interval" : { "lag_history_interval" : {
"_name" : "lag_history_interval",
"type" : "text", "type" : "text",
"value" : "10" "value" : "10"
}, },
"lag_history_max" : { "lag_history_max" : {
"_name" : "lag_history_max",
"type" : "text", "type" : "text",
"value" : "3" "value" : "3"
}, },
"lag_threshold" : { "lag_threshold" : {
"_name" : "lag_threshold",
"type" : "text", "type" : "text",
"value" : "2000" "value" : "2000"
} }
}, },
"messagehistory" : { "messagehistory" : {
"_name" : "messagehistory",
"debug_aka" : { "debug_aka" : {
"_name" : "debug_aka",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"debug_link" : { "debug_link" : {
"_name" : "debug_link",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"max_messages" : { "max_messages" : {
"_name" : "max_messages",
"type" : "text", "type" : "text",
"value" : "32" "value" : "32"
}, },
"max_recall_time" : { "max_recall_time" : {
"_name" : "max_recall_time",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"sqlite_commit_interval" : { "sqlite_commit_interval" : {
"_name" : "sqlite_commit_interval",
"type" : "text", "type" : "text",
"value" : "5" "value" : "5"
}, },
"sqlite_debug" : { "sqlite_debug" : {
"_name" : "sqlite_debug",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
} }
}, },
"nicklist" : { "nicklist" : {
"_name" : "nicklist",
"debug" : { "debug" : {
"_name" : "debug",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
} }
}, },
"plugins" : { "plugins" : {
"_name" : "plugins",
"disabled" : { "disabled" : {
"_name" : "disabled",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
}, },
"noautoload" : { "noautoload" : {
"_name" : "noautoload",
"type" : "text", "type" : "text",
"value" : "0" "value" : "0"
} }
}, },
"spinach" : { "spinach" : {
"_name" : "spinach",
"file" : { "file" : {
"_name" : "file",
"type" : "text", "type" : "text",
"value" : "jeopardy_complete.json" "value" : "jeopardy_complete.json"
} }

4
data/spam_keywords vendored
View File

@ -1,10 +1,8 @@
{ {
"$metadata$" : { "$metadata$" : {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, }
"_name" : "$metadata$"
} }
} }

4
data/unban_timeouts vendored
View File

@ -1,10 +1,8 @@
{ {
"$metadata$" : { "$metadata$" : {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, }
"_name" : "$metadata$"
} }
} }

View File

@ -1,10 +1,8 @@
{ {
"$metadata$" : { "$metadata$" : {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, }
"_name" : "$metadata$"
} }
} }

4
data/users vendored
View File

@ -1,10 +1,8 @@
{ {
"$metadata$" : { "$metadata$" : {
"$metadata$" : { "$metadata$" : {
"_name" : "$metadata$",
"update_version" : 3503 "update_version" : 3503
}, }
"_name" : "$metadata$"
} }
} }

View File

@ -0,0 +1,83 @@
#!/usr/bin/env perl
# Strips redundant _name metadata from HashObject and DualIndexHashObject JSON files
use warnings; use strict;
BEGIN {
use File::Basename;
my $location = -l __FILE__ ? dirname readlink __FILE__ : dirname __FILE__;
unshift @INC, $location;
}
use lib3503::HashObject;
use lib3503::DualIndexHashObject;
use lib3503::PBot;
my ($data_dir, $version, $last_update) = @ARGV;
print "Stripping redundant _name metadata... version: $version, last_update: $last_update, data_dir: $data_dir\n";
my @hashobjects = qw/channels commands capabilities/;
my @dualindex = qw/unban_timeouts unmute_timeouts ban-exemptions ignorelist registry spam_keywords users/;
my $pbot = lib3503::PBot->new();
foreach my $hashobject (@hashobjects) {
print "Updating $data_dir/$hashobject ...\n";
my $obj = lib3503::HashObject->new(name => $hashobject, filename => "$data_dir/$hashobject", pbot => $pbot);
$obj->load;
foreach my $index (keys %{$obj->{hash}}) {
if ($index eq lc $index) {
if (exists $obj->{hash}->{$index}->{_name}) {
if ($obj->{hash}->{$index}->{_name} eq lc $obj->{hash}->{$index}->{_name}) {
delete $obj->{hash}->{$index}->{_name};
}
}
} else {
print "error: $index expected to be all-lowercased; cannot continue\n";
exit 1;
}
}
$obj->save;
}
foreach my $hashobject (@dualindex) {
print "Updating $data_dir/$hashobject ...\n";
my $obj = lib3503::DualIndexHashObject->new(name => $hashobject, filename => "$data_dir/$hashobject", pbot => $pbot);
$obj->load;
foreach my $index1 (keys %{$obj->{hash}}) {
if ($index1 ne lc $index1) {
print "error: primary index $index1 expected to be all-lowercased; cannot continue\n";
exit 1;
}
if (exists $obj->{hash}->{$index1}->{_name}) {
if ($obj->{hash}->{$index1}->{_name} eq lc $obj->{hash}->{$index1}->{_name}) {
delete $obj->{hash}->{$index1}->{_name};
}
}
foreach my $index2 (keys %{$obj->{hash}->{$index1}}) {
next if $index2 eq '_name';
if ($index2 ne lc $index2) {
print "error: $index1.$index2 expected to be all-lowercased; cannot continue\n";
exit 1;
}
if (exists $obj->{hash}->{$index1}->{$index2}->{_name}) {
if ($obj->{hash}->{$index1}->{$index2}->{_name} eq lc $obj->{hash}->{$index1}->{$index2}->{_name}) {
delete $obj->{hash}->{$index1}->{$index2}->{_name};
}
}
}
}
$obj->save;
}
exit 0;