mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 10:59:29 +01:00
30 lines
603 B
Perl
30 lines
603 B
Perl
# File: Handlers.pm
|
|
#
|
|
# Purpose: Loads handlers in the Handlers directory.
|
|
|
|
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
package PBot::Core::Handlers;
|
|
use parent 'PBot::Core::Class';
|
|
|
|
use PBot::Imports;
|
|
|
|
use PBot::Utils::LoadModules qw/load_modules/;
|
|
|
|
sub initialize {
|
|
my ($self, %conf) = @_;
|
|
|
|
# load the handlers in the Handlers directory
|
|
$self->load_handlers(%conf);
|
|
}
|
|
|
|
sub load_handlers {
|
|
my ($self, %conf) = @_;
|
|
|
|
$self->{pbot}->{logger}->log("Loading handlers:\n");
|
|
load_modules($self, 'PBot::Core::Handlers');
|
|
}
|
|
|
|
1;
|