Refactored in a way modules have access to bot infrastructure

This commit is contained in:
Blue 2025-03-09 21:01:41 +02:00
parent c605b3ba93
commit 89c04254b8
Signed by: blue
GPG key ID: 9B203B252A63EE38
25 changed files with 245 additions and 216 deletions

View file

@ -7,9 +7,9 @@
#include <memory>
#include <vector>
#include "gloox/client.h"
#include "component/core.h"
#include "component/actor.h"
#include "connection/connection.h"
namespace Module {
@ -18,8 +18,7 @@ public:
typedef std::vector<std::string> Tokens;
protected:
Module(const std::shared_ptr<gloox::Client>& client);
void sendMessage(const std::shared_ptr<Actor>& actor, const std::string& body);
Module(const std::shared_ptr<Core>& core, const std::shared_ptr<Connection>& connection);
public:
virtual ~Module() noexcept;
@ -29,7 +28,8 @@ public:
virtual void message(const std::shared_ptr<Actor>& actor, const Tokens& args) = 0;
protected:
std::shared_ptr<gloox::Client> client;
std::shared_ptr<Core> core;
std::shared_ptr<Connection> connection;
};