This commit is contained in:
2024-01-30 17:15:10 +01:00
parent 640b2991c8
commit 65557cc1c0
7 changed files with 69 additions and 57 deletions

View File

@@ -1,12 +1,12 @@
/******************************************************************************/
/* */
/* ::: :::::::: */
/* Bot.hpp :+: :+: :+: */
/* bot.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/30 01:54:36 by vvaas #+# #+# */
/* Updated: 2024/01/30 02:39:52 by vvaas ### ########.fr */
/* Updated: 2024/01/30 16:56:57 by vvaas ### ########.fr */
/* */
/******************************************************************************/
@@ -24,6 +24,7 @@ class bot
bot();
void init(void);
void connect_to_server(void);
void handle_response(std::string buffer);
~bot();
private :
struct sockaddr_in _serv_addr;

View File

@@ -6,7 +6,7 @@
/* By: vvaas <vvaas@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/21 10:33:17 by maldavid #+# #+# */
/* Updated: 2024/01/30 01:45:23 by vvaas ### ########.fr */
/* Updated: 2024/01/30 17:06:21 by vvaas ### ########.fr */
/* */
/******************************************************************************/
@@ -17,6 +17,7 @@
#include <string>
#include <set>
#include <errorscode.hpp>
#include <logs.hpp>
namespace irc
{
@@ -40,7 +41,7 @@ namespace irc
inline void login() { _logged = true; }
inline void register_user() { _registered = true; }
inline void welcome() { if (isLogged() && !isWelcomed()) return ; _welcomed = true; sendCode(RPL_WELCOME, "Welcome to yipirc :), " + _nickname); }
inline void welcome() { if (!isLogged() || isWelcomed() || _nickname.empty()) return ; _welcomed = true; sendCode(RPL_WELCOME, "Welcome to yipirc :), " + _nickname); }
inline void requireDisconnect() { _disconnect_required = true; }
inline bool isLogged() const { return _logged; }