Skip to content

Commit a5f1b19

Browse files
authored
Update auth.hpp
1 parent a902a5c commit a5f1b19

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

auth.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,19 @@ namespace KeyAuth {
112112
void load_channel_data(nlohmann::json data) {
113113
api::data.success = data["success"];
114114
api::data.message = data["message"];
115-
for (auto sub : data["messages"])
116-
{
117-
std::string authoroutput = sub[("author")];
118-
std::string messageoutput = sub[("message")];
119-
std::string timestampoutput = sub[("timestamp")];
115+
for (const auto sub : data["messages"]) {
116+
117+
std::string authoroutput = sub["author"];
118+
std::string messageoutput = sub["message"];
119+
int timestamp = sub["timestamp"]; std::string timestampoutput = std::to_string(timestamp);
120120
authoroutput.erase(remove(authoroutput.begin(), authoroutput.end(), '"'), authoroutput.end());
121121
messageoutput.erase(remove(messageoutput.begin(), messageoutput.end(), '"'), messageoutput.end());
122122
timestampoutput.erase(remove(timestampoutput.begin(), timestampoutput.end(), '"'), timestampoutput.end());
123123
channel_struct output = { authoroutput , messageoutput, timestampoutput };
124124
api::data.channeldata.push_back(output);
125125
}
126126
}
127+
}
127128

128129
nlohmann::json response_decoder;
129130

0 commit comments

Comments
 (0)