App-RoboBot
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/App/RoboBot/Message.pm view on Meta::CPAN
$plugin->hook_after($self);
}
}
# Deliver the response
$self->log->debug('Issuing response send.');
$self->response->send;
}
sub update_response_channel {
my ($self, $new_channel, $old_channel) = @_;
if ($self->has_response && $self->has_channel) {
$self->response->channel($new_channel);
}
}
__PACKAGE__->meta->make_immutable;
1;
lib/App/RoboBot/Nick.pm view on Meta::CPAN
die $self->log->fatal('Could not generate nick ID.') unless $self->has_id;
}
# TODO basic normalization of nicks (removing trailing underscores and single
# digits from automatic nick renames for dupe connections)
$self->update_permissions;
}
sub update_permissions {
my ($self) = @_;
$self->log->debug(sprintf('Permissions update request for nick %s.', $self->name));
# TODO: Restore old functionality of per-server permissions. Pre-AnyEvent
# the information to do so was missing, but now we have it back.
$self->log->debug('Collecting default permissions.');
my %denied;
lib/App/RoboBot/Plugin/API/Translate.pm view on Meta::CPAN
if ($self->update_token) {
$self->valid_config(1);
} else {
$self->valid_config(0);
}
} else {
$self->valid_config(0);
}
}
sub update_token {
my ($self) = @_;
# last_authed only changes when it was successful, so if we have a current
# one, skip all the work ahead
return 1 if $self->last_authed > time() - 590;
my $client = $self->bot->config->plugins->{'translate'}{'client'};
my $secret = $self->bot->config->plugins->{'translate'}{'secret'};
my $response = $self->ua->post('https://datamarket.accesscontrol.windows.net/v2/OAuth2-13',
lib/App/RoboBot/Plugin/Social/Karma.pm view on Meta::CPAN
}, {
nick_id => $nick->id,
karma => -1,
from_nick_id => $message->sender->id,
});
}
return;
}
sub update_karma {
my ($self, $message) = @_;
my %nicks = ($message->raw =~ m{([A-Za-z0-9_]+)([+-]{2})}ogs);
return unless scalar(keys %nicks) > 0;
foreach my $nick (keys %nicks) {
my $karma_amount = $nicks{$nick} eq '++' ? 1 : -1;
my $res = $self->bot->config->db->do(q{
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.350 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )