diff --git a/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o b/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o index e377722..0cac562 100644 Binary files a/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o and b/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o differ diff --git a/config.json b/config.json index 612f34d..809664c 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,4 @@ { - "token": "token here", + "token": "OTQ5MTIxNDU2MTY2NTM5Mjk2.YiFwPA.cKj457bZ5x0pFw6w5QaN7ezqg3E", "bot_command": "!gbp" } diff --git a/src/commands.cpp b/src/commands.cpp index cd2ed1a..ed2b19b 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -37,7 +37,6 @@ std::string commandParse(std::vector args) return findNum(std::stoi(args[1])); else return "Invalid command!"; - } else if (args[0] == "findname") { if (args.size() >= 2) return findName(args[1]); @@ -92,8 +91,9 @@ std::string findName(std::string user) { std::map> gbp = readGBPIntoList(); for (std::map>::iterator it = gbp.begin(); it != gbp.end(); it++) { - if (it->second.second == user) + if (it->second.second.find(user) != -1) { return "#" + std::to_string(it->first) + ": " + it->second.second + " (" + std::to_string(it->second.first) + " GBP)\n"; + } } return "User not found!"; }