2010-03-22 08:33:44 +01:00
|
|
|
# File: Factoids.pm
|
|
|
|
#
|
2021-07-27 06:39:44 +02:00
|
|
|
# Purpose: Provides implementation of PBot factoids. Factoids provide the
|
|
|
|
# foundation for most user-submitted commands, as well as aliases, etc.
|
2010-03-22 08:33:44 +01:00
|
|
|
|
2021-07-11 00:00:22 +02:00
|
|
|
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
|
|
|
# SPDX-License-Identifier: MIT
|
2017-03-05 22:33:31 +01:00
|
|
|
|
2021-07-21 07:44:51 +02:00
|
|
|
package PBot::Core::Factoids;
|
|
|
|
use parent 'PBot::Core::Class';
|
2010-03-22 08:33:44 +01:00
|
|
|
|
2021-06-19 06:23:34 +02:00
|
|
|
use PBot::Imports;
|
2015-09-14 19:22:55 +02:00
|
|
|
|
2021-07-27 06:39:44 +02:00
|
|
|
use PBot::Core::Factoids::Code;
|
|
|
|
use PBot::Core::Factoids::Data;
|
|
|
|
use PBot::Core::Factoids::Exporter;
|
|
|
|
use PBot::Core::Factoids::Interpreter;
|
|
|
|
use PBot::Core::Factoids::Modifiers;
|
|
|
|
use PBot::Core::Factoids::Selectors;
|
|
|
|
use PBot::Core::Factoids::Variables;
|
2020-02-26 11:29:02 +01:00
|
|
|
|
2010-03-22 08:33:44 +01:00
|
|
|
sub initialize {
|
2020-02-15 23:38:32 +01:00
|
|
|
my ($self, %conf) = @_;
|
2010-03-22 08:33:44 +01:00
|
|
|
|
2021-07-27 06:39:44 +02:00
|
|
|
$self->{data} = PBot::Core::Factoids::Data->new(%conf);
|
|
|
|
$self->{data}->load;
|
|
|
|
|
|
|
|
$self->{code} = PBot::Core::Factoids::Code->new (%conf);
|
|
|
|
$self->{exporter} = PBot::Core::Factoids::Exporter->new (%conf);
|
|
|
|
$self->{interpreter} = PBot::Core::Factoids::Interpreter->new (%conf);
|
|
|
|
$self->{modifiers} = PBot::Core::Factoids::Modifiers->new (%conf);
|
|
|
|
$self->{selectors} = PBot::Core::Factoids::Selectors->new (%conf);
|
|
|
|
$self->{variables} = PBot::Core::Factoids::Variables->new (%conf);
|
2020-05-30 05:43:07 +02:00
|
|
|
|
2014-05-17 00:11:31 +02:00
|
|
|
|
2020-02-15 23:38:32 +01:00
|
|
|
$self->{pbot}->{registry}->add_default('text', 'factoids', 'default_rate_limit', 15);
|
|
|
|
$self->{pbot}->{registry}->add_default('text', 'factoids', 'max_name_length', 100);
|
|
|
|
$self->{pbot}->{registry}->add_default('text', 'factoids', 'max_content_length', 1024 * 8);
|
|
|
|
$self->{pbot}->{registry}->add_default('text', 'factoids', 'max_channel_length', 20);
|
2010-03-22 08:33:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|