// SPDX-FileCopyrightText: 2024 Yury Gubich // SPDX-License-Identifier: GPL-3.0-or-later #pragma once #include #include #include #include #include #include "shared/definitions.h" #include "shared/result.h" #include "shared/loggable.h" #include "component/core.h" #include "component/actor.h" #include "component/config.h" namespace Module { class Module : protected Shared::Loggable { protected: Module(const std::shared_ptr& core, const Config::Module& conf, const std::string& name); bool hasPermission(const std::string& permission, const std::shared_ptr<::Actor>& actor) const; public: virtual ~Module() noexcept; static std::string lower(const std::string& text); virtual Shared::Result message(const std::shared_ptr<::Actor>& actor, const Shared::Strings& args) = 0; public: const std::string name; const std::string alias; protected: std::shared_ptr core; Shared::Permissions permissions; }; }