Added API::IRC::ison for checking if a user is on a channel.
This commit is contained in:
1 parent
338551b44c
commit
105e83699d
2 files changed
+13
-1
No files matched your search
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
* Added API::IRC::ison for checking if a user is on a channel.
|
||||||
* Werewolf: Fixed a bug in harlot staying home.
|
* Werewolf: Fixed a bug in harlot staying home.
|
||||||
* Werewolf: Various bug fixes.
|
* Werewolf: Various bug fixes.
|
||||||
* Werewolf 1.06: Fixed an annoyance and added traitor transformation.
|
* Werewolf 1.06: Fixed an annoyance and added traitor transformation.
|
||||||
|
|||||||
+12
-1
@@ -9,7 +9,7 @@ use Exporter;
|
|||||||
use base qw(Exporter);
|
use base qw(Exporter);
|
||||||
|
|
||||||
our @EXPORT_OK = qw(ban cjoin cpart cmode umode kick privmsg notice quit nick names
|
our @EXPORT_OK = qw(ban cjoin cpart cmode umode kick privmsg notice quit nick names
|
||||||
topic who usrc match_mask);
|
topic who usrc match_mask ison);
|
||||||
|
|
||||||
# Create the on_disconnect event.
|
# Create the on_disconnect event.
|
||||||
API::Std::event_add('on_disconnect');
|
API::Std::event_add('on_disconnect');
|
||||||
@@ -130,6 +130,17 @@ sub act {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if a given nickname is on a channel.
|
||||||
|
sub ison {
|
||||||
|
my ($svr, $chan, $nick) = @_;
|
||||||
|
|
||||||
|
if (!exists $State::IRC::chanusers{$svr}) { return }
|
||||||
|
if (!exists $State::IRC::chanusers{$svr}{$chan}) { return }
|
||||||
|
if (!exists $State::IRC::chanusers{$svr}{$chan}{lc $nick}) { return }
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
# Change bot nickname.
|
# Change bot nickname.
|
||||||
sub nick {
|
sub nick {
|
||||||
my ($svr, $newnick) = @_;
|
my ($svr, $newnick) = @_;
|
||||||
|
|||||||
Reference in new issue
Block a user