From 08714a202d0eff3dfd31a4b0dd7f3311b0fd3f0e Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 7 May 2024 00:23:22 +0500 Subject: upd: struct for twitch credentials --- src/config.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/config.cpp') diff --git a/src/config.cpp b/src/config.cpp index 45209e4..3af6e24 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -19,6 +19,7 @@ namespace bot { } Configuration cfg; + TwitchCredentialsConfiguration ttv_crd_cfg; DatabaseConfiguration db_cfg; std::string line; @@ -34,12 +35,10 @@ namespace bot { c = tolower(c); } - if (key == "bot_username") { - cfg.bot_username = value; - } else if (key == "bot_password") { - cfg.bot_password = value; - } else if (key == "bot_client_id") { - cfg.bot_client_id = value; + if (key == "twitch_credentials.client_id") { + ttv_crd_cfg.client_id = value; + } else if (key == "twitch_credentials.token") { + ttv_crd_cfg.token = value; } else if (key == "db_name") { db_cfg.name = value; } else if (key == "db_user") { @@ -53,6 +52,7 @@ namespace bot { } } + cfg.twitch_credentials = ttv_crd_cfg; cfg.database = db_cfg; return cfg; -- cgit v1.2.3