Skip to content

Commit 53a2f06

Browse files
Merge pull request #24 from Shxde1/main
Fix for chat
2 parents a902a5c + ef8ebb3 commit 53a2f06

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

auth.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ 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());

0 commit comments

Comments
 (0)