From 6572077c73406cf6c353395aad13d493929a1596 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 21 Apr 2024 16:37:31 +0500 Subject: feat: say() method --- src/irc/client.cpp | 4 ++++ src/irc/client.hpp | 1 + 2 files changed, 5 insertions(+) (limited to 'src/irc') diff --git a/src/irc/client.cpp b/src/irc/client.cpp index 08a3ff3..dde9a5c 100644 --- a/src/irc/client.cpp +++ b/src/irc/client.cpp @@ -90,6 +90,10 @@ void Client::run() { this->websocket.run(); } +void Client::say(const std::string &channel_login, const std::string &message) { + this->raw("PRIVMSG #" + channel_login + " :" + message); +} + bool Client::join(const std::string &channel_login) { auto already_joined = std::any_of(this->joined_channels.begin(), this->joined_channels.end(), diff --git a/src/irc/client.hpp b/src/irc/client.hpp index 2598550..36d7382 100644 --- a/src/irc/client.hpp +++ b/src/irc/client.hpp @@ -16,6 +16,7 @@ namespace bot { void run(); + void say(const std::string &channel_login, const std::string &message); bool join(const std::string &channel_login); void raw(const std::string &raw_message); -- cgit v1.2.3