+after discord_message_create => sub {
+ my $self = shift;
+ my $hash = shift;
+
+ my $author = $hash->{author};
+ my $msg = $hash->{content};
+ my $channel_id = $hash->{channel_id};
+ my $author_name = $author->{username};
+ my $author_id = $author->{id};
+ say localtime(time) . "$channel_id $author_name $author_id";
+ return if $author->{'id'} eq $self->discord_id; # Ignore my own messages
+
+ my $channel = "#testarlite";
+
+ my ($p,$command,$args) = ($msg =~ /^([.!~])(\S+)(?: (.+))?/);
+
+ say localtime(time) . " - $msg";
+
+ return 0 unless $self->disp->has_command($command,$channel);
+
+
+ my $c = NDIRC::DiscordContext->new({
+ discord_id => $author_id,
+ channel_id => $channel_id,
+ channel => $channel,
+ disp => $self->disp,
+ model => DB(),
+ discord => $self->discord,
+ });
+
+ return $self->disp->run_command($c,$command,$args);
+
+};
+