From e6fe5b33925ceba2cb96933b707d142de6b12f23 Mon Sep 17 00:00:00 2001 From: sha512sum Date: Wed, 23 Oct 2024 18:05:18 +0000 Subject: [PATCH] Add ChangeNick Method --- include/yail/core.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/yail/core.hpp b/include/yail/core.hpp index da67fa7..1ae9f77 100644 --- a/include/yail/core.hpp +++ b/include/yail/core.hpp @@ -118,6 +118,12 @@ struct IrcClient { co_await boost::asio::async_write(this->socket, boost::asio::buffer(request), boost::asio::transfer_all(), boost::asio::use_awaitable); }; + auto ChangeNick(std::string nick) -> boost::asio::awaitable { + const auto request = std::format("NICK {}", nick); + + co_await boost::asio::async_write(this->socket, boost::asio::buffer(request), boost::asio::transfer_all(), boost::asio::use_awaitable); + this->nick = std::move(nick); + }; template auto SendEvent(Event&& event) -> boost::asio::awaitable { return [&](utempl::TypeList...>>) {