X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Dispatcher.pm;h=a11ae53cda91800f387dcd4fae40c874a2a9b045;hb=refs%2Fheads%2Fdiscord;hp=76beef574c6687127d2fe3cb1bcc05501d4c40dd;hpb=445fc8eeeb37b4728b1d7608862e772856eebb19;p=NDIRC.git diff --git a/Dispatcher.pm b/Dispatcher.pm index 76beef5..a11ae53 100644 --- a/Dispatcher.pm +++ b/Dispatcher.pm @@ -87,6 +87,7 @@ sub add_channel { my ($self,$channel,$types) = @_; $types = Set::Object->new(@{$types}); + $types->insert('universal'); $self->channels->{lc $channel} = $types; } @@ -96,9 +97,10 @@ sub has_command { return 0 unless defined $command && defined $channel; return 0 unless exists $self->commands->{$command}; + $command = $self->commands->{$command}; + return 1 if $command->type eq 'universal'; return 0 unless exists $self->channels->{$channel}; - $command = $self->commands->{$command}; return $self->channels->{$channel}->has($command->type); }