metabot/lib/MetaBot/Core.pm

41 lines
No EOL
627 B
Perl

use v5.32;
use strict;
use warnings;
use Object::Pad;
# Using this directly because I don't like flexibility;
use IO::Async::Loop::Epoll;
use MetaBot::Config;
class MetaBot::Core {
use Carp qw/cluck/;
has $_loop;
has $_config;
BUILD {
my ($configfile) = @_;
$_config = MetaBot::Config->new($configfile);
$_loop = IO::Async::Loop::Epoll->new();
}
method get_loop() {$_loop}
method get_config() {$_config}
method log(@a) {
print @a, "\n";
}
method err(@a) {
cluck @a;
die;
}
method run_plugins(@args) {
$self->log("PLUGINS", "run", "called with [@_]")
}
}
1;