diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-09 01:40:52 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-09 01:40:52 +0500 |
| commit | 9d81978d4c875899d1493b7047895db8c7528292 (patch) | |
| tree | af74bd53a133ec8f240c54c8494e5d807c99d55f /src/modules | |
| parent | 11d76c7ade400b36af5cac71b4247280537f261b (diff) | |
feat: show c++ and compiler versions in !ping command
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/ping.hpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/modules/ping.hpp b/src/modules/ping.hpp index b6409ca..836917d 100644 --- a/src/modules/ping.hpp +++ b/src/modules/ping.hpp @@ -32,9 +32,26 @@ namespace bot { int used_memory = usage.ru_maxrss / 1024; + std::string cpp_info; + +#ifdef __cplusplus + cpp_info.append("C++" + std::to_string(__cplusplus).substr(2, 2)); +#endif + +#ifdef __VERSION__ + cpp_info.append(" (gcc " + + bot::utils::string::split_text(__VERSION__, ' ')[0] + + ")"); +#endif + + if (!cpp_info.empty()) { + cpp_info.append(" ยท "); + } + return bundle.localization - .get_formatted_line(request, loc::LineId::PingResponse, - {uptime, std::to_string(used_memory)}) + .get_formatted_line( + request, loc::LineId::PingResponse, + {cpp_info, uptime, std::to_string(used_memory)}) .value(); } }; |
