summaryrefslogtreecommitdiffstats
path: root/modules/command.pl
diff options
context:
space:
mode:
authorLibravatarJanik Kleinhoff <janik@kleinhoff.de>2015-09-24 01:32:11 +0000
committerLibravatarJanik Kleinhoff <janik@kleinhoff.de>2015-09-24 01:32:11 +0000
commit9b472795d26cd93d1bb58488ef60a062f5237295 (patch)
tree8572778595d145176e720a1b7168c73adbd64ed4 /modules/command.pl
parentb93c3a24f14e0f64bc46b4945a65ae1bba62dc12 (diff)
Rework module paths
Diffstat (limited to 'modules/command.pl')
-rw-r--r--modules/command.pl61
1 files changed, 0 insertions, 61 deletions
diff --git a/modules/command.pl b/modules/command.pl
deleted file mode 100644
index aa79f4d..0000000
--- a/modules/command.pl
+++ /dev/null
@@ -1,61 +0,0 @@
-package ASM::Commander;
-
-use warnings;
-use strict;
-use IO::All;
-use POSIX qw(strftime);
-use Data::Dumper;
-use URI::Escape;
-
-sub new
-{
- my $module = shift;
- my $self = {};
- bless($self);
- return $self;
-}
-
-sub command
-{
- my ($self, $conn, $event) = @_;
- my $args = $event->{args}->[0];
- my $from = $event->{from};
- my $cmd = $args;
- my $d1;
- my $nick = lc $event->{nick};
- my $acct = lc $::sn{$nick}->{account};
-# return 0 unless (ASM::Util->speak($event->{to}->[0]));
- foreach my $command ( @{$::commands->{command}} )
- {
- my $fail = 0;
- unless ( (ASM::Util->speak($event->{to}->[0])) ) {
- next unless (defined($command->{nohush}) && ($command->{nohush} eq "nohush"));
- }
- if (defined($command->{flag})) { #If the command is restricted,
- if (!defined($::users->{person}->{$acct})) { #make sure the requester has an account
- $fail = 1;
- }
- elsif (!defined($::users->{person}->{$acct}->{flags})) { #make sure the requester has flags defined
- $fail = 1;
- }
- elsif (!(grep {$_ eq $command->{flag}} split('', $::users->{person}->{$acct}->{flags}))) { #make sure the requester has the needed flags
- $fail = 1;
- }
- }
- if ($cmd=~/$command->{cmd}/) {
- ASM::Util->dprint("$event->{from} told me: $cmd", "commander");
- if (!ASM::Util->notRestricted($nick, "nocommands")) {
- $fail = 1;
- }
- if ($fail == 1) {
- $conn->privmsg($nick, "You don't have permission to use that command, or you're not signed into nickserv.");
- } else {
- eval $command->{content};
- warn $@ if $@;
- }
- last;
- }
- }
-}
-
-1;