mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 05:49:27 +01:00
Allow unquiet from /msg
This commit is contained in:
parent
0c54d9c93e
commit
73a12dc981
@ -79,17 +79,20 @@ sub unquiet {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(not $from =~ /^#/) { #not a channel
|
my ($target, $channel) = split / /, $arguments;
|
||||||
return "/msg $nick This command must be used in the channel.";
|
|
||||||
|
if(not defined $target) {
|
||||||
|
return "/msg $nick Usage: unquiet <nick> [channel]";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(not defined $arguments) {
|
$channel = $from if not defined $channel;
|
||||||
return "/msg $nick Usage: unquiet nick";
|
|
||||||
}
|
return "/msg $nick Unquiet must be used against a channel. Either use in channel, or specify !unquiet $target <channel>" if $channel !~ /^#/;
|
||||||
|
|
||||||
$self->{pbot}->chanops->unquiet_nick($arguments, $from);
|
$self->{pbot}->chanops->unquiet_nick($arguments, $from);
|
||||||
delete ${ $self->{pbot}->chanops->{quieted_nicks} }{$arguments};
|
delete ${ $self->{pbot}->chanops->{quieted_nicks} }{$arguments};
|
||||||
$self->{pbot}->conn->privmsg($arguments, "$nick has allowed you to speak again.") unless $arguments =~ /\Q$self->{pbot}->botnick\E/i;
|
$self->{pbot}->conn->privmsg($arguments, "$nick has allowed you to speak again.") unless $arguments =~ /\Q$self->{pbot}->botnick\E/i;
|
||||||
|
return "Done.";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub ban_user {
|
sub ban_user {
|
||||||
|
@ -50,6 +50,9 @@ sub gain_ops {
|
|||||||
|
|
||||||
if(not exists ${ $self->{is_opped} }{$channel}) {
|
if(not exists ${ $self->{is_opped} }{$channel}) {
|
||||||
$self->{pbot}->conn->privmsg("chanserv", "op $channel");
|
$self->{pbot}->conn->privmsg("chanserv", "op $channel");
|
||||||
|
$self->{is_opped}->{$channel}{timeout} = gettimeofday + 300; # assume we're going to be opped
|
||||||
|
$self->{pbot}->{irc}->flush_output_queue();
|
||||||
|
$self->{pbot}->{irc}->do_one_loop();
|
||||||
} else {
|
} else {
|
||||||
$self->perform_op_commands();
|
$self->perform_op_commands();
|
||||||
}
|
}
|
||||||
@ -77,6 +80,8 @@ sub perform_op_commands {
|
|||||||
}
|
}
|
||||||
shift(@{ $self->{op_commands} });
|
shift(@{ $self->{op_commands} });
|
||||||
}
|
}
|
||||||
|
$self->{pbot}->{irc}->flush_output_queue();
|
||||||
|
$self->{pbot}->{irc}->do_one_loop();
|
||||||
$self->{pbot}->logger->log("Done.\n");
|
$self->{pbot}->logger->log("Done.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user