X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Bot.pm;h=3cb565ff7638dcd4e9159003607229332327a4b3;hb=8727f6aa2a111483e54639e6d85d9865063f2b19;hp=2fc95c2ba7b55ba9386709fbf9fa924e233e3cd6;hpb=26cc9349b7b35318231d1dc8f236a7ac3dc8dcf2;p=NDIRC.git diff --git a/Bot.pm b/Bot.pm index 2fc95c2..3cb565f 100644 --- a/Bot.pm +++ b/Bot.pm @@ -147,6 +147,7 @@ sub _start { )); $self->discord->gw->on('MESSAGE_CREATE' => sub { $self->discord_message_create(@_) }); + $self->discord->gw->on('MESSAGE_UPDATE' => sub { $self->discord_message_create(@_) }); $self->discord->gw->on('READY' => sub { $self->discord_ready(@_) }); $self->discord->gw->on('GUILD_CREATE' => sub { $self->discord_guild_create(@_) }); $self->discord->gw->on('CHANNEL_CREATE' => sub { $self->discord_channel_create(@_) }); @@ -239,16 +240,16 @@ sub sig_usr2 { sub _build_disp { my ($self) = @_; - my $disp = new NDIRC::Dispatcher; + my $disp = NDIRC::Dispatcher->new; - if (my $commands = new IO::File 'commands'){ + if (my $commands = IO::File->new('commands')){ my @commands = split /\W+/, do{local $/; <$commands>}; say "Loading commands from: @commands"; $disp->load(@commands); } %{$self->targets} = (); - my $channels = new IO::File 'channels' or die $!;; + my $channels = IO::File->new('channels') or die $!;; while (<$channels>){ my ($chan, @types) = split /\s+/; say "$chan - @types";