// 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" namespace Module { class Module : protected Shared::Loggable { protected: Module(const std::shared_ptr& core, const Shared::Permissions& permissions, const std::string& name); bool hasPermission(const std::string& permission, const std::shared_ptr<::Actor>& actor) const; public: virtual ~Module() noexcept; static Shared::Strings split(const std::string& string, const std::string& delimiter = " "); static std::string lower(const std::string& text); virtual Shared::Result message(const std::shared_ptr<::Actor>& actor, const Shared::Strings& args) = 0; protected: std::shared_ptr core; Shared::Permissions permissions; }; }