1
0
Fork 0
mirror of https://gitlab.com/niansa/asbots.git synced 2025-03-06 20:48:25 +01:00
asbots/serviceBase.hpp
2021-06-21 12:18:40 +02:00

30 lines
690 B
C++

#ifndef _SERVICEBASE_HPP
#define _SERVICEBASE_HPP
class Event;
class User;
class Instance;
#include "uid.hpp"
#include "incompletes.hpp"
#include <async/result.hpp>
#include <string>
#include <string_view>
#include <optional>
class ServiceBase {
public:
UUID uuid;
Instance *i;
bool ready = false;
virtual async::result<void> intitialize() = 0;
virtual async::result<void> on_event(const Event& event) = 0;
virtual async::result<void> on_direct_privmsg(std::string_view msg, u_User& author) = 0;
async::result<void> mark_ready(const User& user);
std::optional<std::string_view> getConfig(const std::string& section, const std::string& key);
};
#endif