| 1 | /************************************************************************************ |
| 2 | * |
| 3 | * D++, A Lightweight C++ library for Discord |
| 4 | * |
| 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | * Copyright 2021 Craig Edwards and D++ contributors |
| 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) |
| 8 | * |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | * you may not use this file except in compliance with the License. |
| 11 | * You may obtain a copy of the License at |
| 12 | * |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | * |
| 15 | * Unless required by applicable law or agreed to in writing, software |
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | * See the License for the specific language governing permissions and |
| 19 | * limitations under the License. |
| 20 | * |
| 21 | ************************************************************************************/ |
| 22 | #include "test.h"cxx . . $ `<file>/src/unittest/test.h`/ |
| 23 | |
| 24 | #include <dpp/dpp.h>cxx . . $ `<file>/include/dpp/dpp.h`/ |
| 25 | #include <dpp/unicode_emoji.h>cxx . . $ `<file>/include/dpp/unicode_emoji.h`/ |
| 26 | #include <dpp/restrequest.h>cxx . . $ `<file>/include/dpp/restrequest.h`/ |
| 27 | #include <dpp/json.h>cxx . . $ `<file>/include/dpp/json.h`/ |
| 28 | |
| 29 | /** |
| 30 | * @brief global lock for log output |
| 31 | */ |
| 32 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# loglockcxx . . $ loglock.; |
| 33 | |
| 34 | /** |
| 35 | * @brief Type trait to check if a certain type has a build_json method |
| 36 | * |
| 37 | * @tparam T type to check for |
| 38 | */ |
| 39 | template <typename T, typename = stdcxx . . $ std/::void_t<>> |
| 40 | struct has_build_jsoncxx . . $ has_build_json# : stdcxx . . $ std/::false_type {}; |
| 41 | |
| 42 | template <typename T> |
| 43 | struct has_build_jsoncxx . . $ has_build_json#<T, stdcxx . . $ std/::void_t<decltype(stdcxx . . $ std/::declval<T&>().build_json())>> : stdcxx . . $ std/::true_type {}; |
| 44 | |
| 45 | /** |
| 46 | * @brief Type trait to check if a certain type has a build_json method |
| 47 | * |
| 48 | * @tparam T type to check for |
| 49 | */ |
| 50 | template <typename T> |
| 51 | constexpr bool has_build_json_vcxx . . $ has_build_json_v. = has_build_jsoncxx . . $ has_build_json#<T>::value; |
| 52 | |
| 53 | /** |
| 54 | * @brief Type trait to check if a certain type has a fill_from_json method |
| 55 | * |
| 56 | * @tparam T type to check for |
| 57 | */ |
| 58 | template <typename T, typename = void> |
| 59 | struct has_fill_from_jsoncxx . . $ has_fill_from_json# : stdcxx . . $ std/::false_type {}; |
| 60 | |
| 61 | template <typename T> |
| 62 | struct has_fill_from_jsoncxx . . $ has_fill_from_json#<T, stdcxx . . $ std/::void_t<decltype(stdcxx . . $ std/::declval<T&>().fill_from_json(stdcxx . . $ std/::declval<dppcxx . . $ dpp/::jsoncxx . . $ dpp/json#*>()))>> : stdcxx . . $ std/::true_type {}; |
| 63 | |
| 64 | /** |
| 65 | * @brief Type trait to check if a certain type has a fill_from_json method |
| 66 | * |
| 67 | * @tparam T type to check for |
| 68 | */ |
| 69 | template <typename T> |
| 70 | constexpr bool has_fill_from_json_vcxx . . $ has_fill_from_json_v. = has_fill_from_jsoncxx . . $ has_fill_from_json#<T>::value; |
| 71 | |
| 72 | /* Unit tests go here */ |
| 73 | int maincxx . . $ main(afcd3168fc1188a4).(int argc, char *argv[]) |
| 74 | { |
| 75 | try { |
| 76 | |
| 77 | stdcxx . . $ std/::stringcxx . . $ std/string# token(get_tokencxx . . $ get_token(efd28698952f529a).()); |
| 78 | |
| 79 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "[" <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(3) <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). (dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::time_fcxx . . $ dpp/utility/time_f(31fa7155c10fdd13).() - get_start_timecxx . . $ get_start_time(31fa7155c10fdd13).()) <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "]: [\u001b[36mSTART\u001b[0m] "; |
| 80 | if (offlinecxx . . $ offline.) { |
| 81 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Running offline unit tests only.\n"; |
| 82 | } else { |
| 83 | if (argc > 1 && stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(argv + 1, argv + argc, [](const char *a) { return (stdcxx . . $ std/::strcmp(a, "full") == 0); }) != argv + argc) { |
| 84 | extendedcxx . . $ extended. = true; |
| 85 | } |
| 86 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Running offline and " <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). (extendedcxx . . $ extended. ? "extended" : "limited") <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " online unit tests. Guild ID: " <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). TEST_GUILD_IDcxx . . $ TEST_GUILD_ID. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " Text Channel ID: " <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). TEST_TEXT_CHANNEL_IDcxx . . $ TEST_TEXT_CHANNEL_ID. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " VC ID: " <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). TEST_VC_IDcxx . . $ TEST_VC_ID. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " User ID: " <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). TEST_USER_IDcxx . . $ TEST_USER_ID. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " Event ID: " <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). TEST_EVENT_IDcxx . . $ TEST_EVENT_ID. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\n"; |
| 87 | } |
| 88 | |
| 89 | stdcxx . . $ std/::stringcxx . . $ std/string# test_to_escape = "*** _This is a test_ ***\n```cpp\n\ |
| 90 | int main() {\n\ |
| 91 | /* Comment */\n\ |
| 92 | int answer = 42;\n\ |
| 93 | return answer; // ___\n\ |
| 94 | };\n\ |
| 95 | ```\n\ |
| 96 | Markdown lol ||spoiler|| ~~strikethrough~~ `small *code* block`\n"; |
| 97 | |
| 98 | set_testcxx . . $ set_test(c715a584a48bbbaa).(COMPARISONcxx . . $ COMPARISON., false); |
| 99 | dppcxx . . $ dpp/::usercxx . . $ dpp/user# u1cxx . . $ dpp/user#user(49f6e7a06ebc5aa8).; |
| 100 | dppcxx . . $ dpp/::usercxx . . $ dpp/user# u2cxx . . $ dpp/user#user(49f6e7a06ebc5aa8).; |
| 101 | dppcxx . . $ dpp/::usercxx . . $ dpp/user# u3cxx . . $ dpp/user#user(49f6e7a06ebc5aa8).; |
| 102 | u1.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). u2.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 666; |
| 103 | u3.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 777; |
| 104 | set_testcxx . . $ set_test(c715a584a48bbbaa).(COMPARISONcxx . . $ COMPARISON., u1 ==cxx . . $ dpp/managed#`operator==`(3fa56817ec02e95). u2 && u1 !=cxx . . $ dpp/managed#`operator!=`(3fa56817ec02e95). u3); |
| 105 | |
| 106 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BIGNUMcxx . . $ BIGNUM., false); |
| 107 | stdcxx . . $ std/::stringcxx . . $ std/string# big_incxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).{"1234567890123456789012345678901234567890"}; |
| 108 | dppcxx . . $ dpp/::bignumbercxx . . $ dpp/bignumber# bigcxx . . $ dpp/bignumber#bignumber(9c546c94e5fcce4e).(big_in); |
| 109 | stdcxx . . $ std/::stringcxx . . $ std/string# returned = big.get_numbercxx . . $ dpp/bignumber#get_number(66f8cb911a5426e1).(); |
| 110 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BIGNUMcxx . . $ BIGNUM., big_in ==cxx . . $ std/`operator==`(5ea818b58063a774). returned); |
| 111 | |
| 112 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BIGNUM2cxx . . $ BIGNUM2., false); |
| 113 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<uint64_tcxx . . $ uint64_t#> veccxx . . $ std/vector#vector(9619226211e5a241).{0xff00ff00ff00ff00, 0x1122334455667788}; |
| 114 | dppcxx . . $ dpp/::bignumbercxx . . $ dpp/bignumber# big2cxx . . $ dpp/bignumber#bignumber(8ee78997e2078c50).(veccxx . . $ std/vector#vector(a1201200cf0efa42).); |
| 115 | returned =cxx . . $ std/__cxx11/basic_string#`operator=`(36befb0d0c9f966). big2.get_numbercxx . . $ dpp/bignumber#get_number(66f8cb911a5426e1).(true); |
| 116 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BIGNUM2cxx . . $ BIGNUM2., dppcxx . . $ dpp/::lowercasecxx . . $ dpp/lowercase(facaea4502a33e10).(returned) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "1122334455667788ff00ff00ff00ff00"); |
| 117 | |
| 118 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BIGNUM3cxx . . $ BIGNUM3., false); |
| 119 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<uint64_tcxx . . $ uint64_t#> ret_bin = big2.get_binarycxx . . $ dpp/bignumber#get_binary(c6f7f349a3ef35a1).(); |
| 120 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BIGNUM3cxx . . $ BIGNUM3., ret_bin.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() == 2 && ret_bin[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0] == 0xff00ff00ff00ff00 && ret_bin[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).1] == 0x1122334455667788); |
| 121 | |
| 122 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ERRORScxx . . $ ERRORS., false); |
| 123 | |
| 124 | /* Prepare a confirmation_callback_t in error state (400) */ |
| 125 | dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# error_testcxx . . $ dpp/confirmation_callback_t#confirmation_callback_t(ced63f7c635d850d).; |
| 126 | bool error_message_success = false; |
| 127 | error_test.http_infocxx . . $ dpp/confirmation_callback_t#http_info..statuscxx . . $ dpp/http_request_completion_t#status. = 400; |
| 128 | |
| 129 | error_test.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "{\ |
| 130 | \"message\": \"Invalid Form Body\",\ |
| 131 | \"code\": 50035,\ |
| 132 | \"errors\": {\ |
| 133 | \"options\": {\ |
| 134 | \"0\": {\ |
| 135 | \"name\": {\ |
| 136 | \"_errors\": [\ |
| 137 | {\ |
| 138 | \"code\": \"STRING_TYPE_REGEX\",\ |
| 139 | \"message\": \"String value did not match validation regex.\"\ |
| 140 | },\ |
| 141 | {\ |
| 142 | \"code\": \"APPLICATION_COMMAND_INVALID_NAME\",\ |
| 143 | \"message\": \"Command name is invalid\"\ |
| 144 | }\ |
| 145 | ]\ |
| 146 | }\ |
| 147 | }\ |
| 148 | }\ |
| 149 | }\ |
| 150 | }"; |
| 151 | error_message_success = (error_test.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "50035: Invalid Form Body\n\t- options[0].name: String value did not match validation regex. (STRING_TYPE_REGEX)\n\t- options[0].name: Command name is invalid (APPLICATION_COMMAND_INVALID_NAME)"); |
| 152 | |
| 153 | error_test.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "{\ |
| 154 | \"message\": \"Invalid Form Body\",\ |
| 155 | \"code\": 50035,\ |
| 156 | \"errors\": {\ |
| 157 | \"type\": {\ |
| 158 | \"_errors\": [\ |
| 159 | {\ |
| 160 | \"code\": \"BASE_TYPE_CHOICES\",\ |
| 161 | \"message\": \"Value must be one of {4, 5, 9, 10, 11}.\"\ |
| 162 | }\ |
| 163 | ]\ |
| 164 | }\ |
| 165 | }\ |
| 166 | }"; |
| 167 | error_message_success = (error_message_success && error_test.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "50035: Invalid Form Body - type: Value must be one of {4, 5, 9, 10, 11}. (BASE_TYPE_CHOICES)"); |
| 168 | |
| 169 | error_test.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "{\ |
| 170 | \"message\": \"Unknown Guild\",\ |
| 171 | \"code\": 10004\ |
| 172 | }"; |
| 173 | error_message_success = (error_message_success && error_test.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "10004: Unknown Guild"); |
| 174 | |
| 175 | error_test.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "{\ |
| 176 | \"message\": \"Invalid Form Body\",\ |
| 177 | \"code\": 50035,\ |
| 178 | \"errors\": {\ |
| 179 | \"allowed_mentions\": {\ |
| 180 | \"_errors\": [\ |
| 181 | {\ |
| 182 | \"code\": \"MESSAGE_ALLOWED_MENTIONS_PARSE_EXCLUSIVE\",\ |
| 183 | \"message\": \"parse:[\\\"users\\\"] and users: [ids...] are mutually exclusive.\"\ |
| 184 | }\ |
| 185 | ]\ |
| 186 | }\ |
| 187 | }\ |
| 188 | }"; |
| 189 | error_message_success = (error_message_success && error_test.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "50035: Invalid Form Body - allowed_mentions: parse:[\"users\"] and users: [ids...] are mutually exclusive. (MESSAGE_ALLOWED_MENTIONS_PARSE_EXCLUSIVE)"); |
| 190 | |
| 191 | error_test.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "{\ |
| 192 | \"message\": \"Invalid Form Body\",\ |
| 193 | \"code\": 50035,\ |
| 194 | \"errors\": {\ |
| 195 | \"1\": {\ |
| 196 | \"options\": {\ |
| 197 | \"1\": {\ |
| 198 | \"description\": {\ |
| 199 | \"_errors\": [\ |
| 200 | {\ |
| 201 | \"code\": \"BASE_TYPE_BAD_LENGTH\",\ |
| 202 | \"message\": \"Must be between 1 and 100 in length.\"\ |
| 203 | }\ |
| 204 | ]\ |
| 205 | }\ |
| 206 | }\ |
| 207 | }\ |
| 208 | }\ |
| 209 | }\ |
| 210 | }"; |
| 211 | error_message_success = (error_message_success && error_test.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "50035: Invalid Form Body - <array>[1].options[1].description: Must be between 1 and 100 in length. (BASE_TYPE_BAD_LENGTH)"); |
| 212 | |
| 213 | error_test.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "{\ |
| 214 | \"message\": \"Invalid Form Body\",\ |
| 215 | \"code\": 50035,\ |
| 216 | \"errors\": {\ |
| 217 | \"data\": {\ |
| 218 | \"poll\": {\ |
| 219 | \"_errors\": [\ |
| 220 | {\ |
| 221 | \"code\": \"POLL_TYPE_QUESTION_ALLOWS_TEXT_ONLY\",\ |
| 222 | \"message\": \"This poll type cannot include attachments, emoji or stickers with the question\"}\ |
| 223 | ]\ |
| 224 | }\ |
| 225 | }\ |
| 226 | }\ |
| 227 | }"; |
| 228 | error_message_success = (error_message_success && error_test.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "50035: Invalid Form Body - data.poll: This poll type cannot include attachments, emoji or stickers with the question (POLL_TYPE_QUESTION_ALLOWS_TEXT_ONLY)"); |
| 229 | |
| 230 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ERRORScxx . . $ ERRORS., error_message_success); |
| 231 | |
| 232 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MD_ESC_1cxx . . $ MD_ESC_1., false); |
| 233 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MD_ESC_2cxx . . $ MD_ESC_2., false); |
| 234 | stdcxx . . $ std/::stringcxx . . $ std/string# escaped1 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::markdown_escapecxx . . $ dpp/utility/markdown_escape(928a7cccc7cc580f).(test_to_escape); |
| 235 | stdcxx . . $ std/::stringcxx . . $ std/string# escaped2 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::markdown_escapecxx . . $ dpp/utility/markdown_escape(928a7cccc7cc580f).(test_to_escape, true); |
| 236 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MD_ESC_1cxx . . $ MD_ESC_1., escaped1 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "\\*\\*\\* \\_This is a test\\_ \\*\\*\\*\n\ |
| 237 | ```cpp\n\ |
| 238 | int main() {\n\ |
| 239 | /* Comment */\n\ |
| 240 | int answer = 42;\n\ |
| 241 | return answer; // ___\n\ |
| 242 | };\n\ |
| 243 | ```\n\ |
| 244 | Markdown lol \\|\\|spoiler\\|\\| \\~\\~strikethrough\\~\\~ `small *code* block`\n"); |
| 245 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MD_ESC_2cxx . . $ MD_ESC_2., escaped2 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "\\*\\*\\* \\_This is a test\\_ \\*\\*\\*\n\ |
| 246 | \\`\\`\\`cpp\n\ |
| 247 | int main\\(\\) {\n\ |
| 248 | /\\* Comment \\*/\n\ |
| 249 | int answer = 42;\n\ |
| 250 | return answer; // \\_\\_\\_\n\ |
| 251 | };\n\ |
| 252 | \\`\\`\\`\n\ |
| 253 | Markdown lol \\|\\|spoiler\\|\\| \\~\\~strikethrough\\~\\~ \\`small \\*code\\* block\\`\n"); |
| 254 | |
| 255 | set_testcxx . . $ set_test(c715a584a48bbbaa).(URLENCcxx . . $ URLENC., false); |
| 256 | set_testcxx . . $ set_test(c715a584a48bbbaa).(URLENCcxx . . $ URLENC., dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_encodecxx . . $ dpp/utility/url_encode(fd626fc03107dd24).("ABC123_+\\|$*/AAA[]😄"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ABC123_%2B%5C%7C%24%2A%2FAAA%5B%5D%F0%9F%98%84"); |
| 257 | |
| 258 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BASE64ENCcxx . . $ BASE64ENC., false); |
| 259 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BASE64ENCcxx . . $ BASE64ENC., |
| 260 | dppcxx . . $ dpp/::base64_encodecxx . . $ dpp/base64_encode(e95b56f114df2c56).(reinterpret_cast<unsigned char const *>("a"), 1) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "YQ==" && |
| 261 | dppcxx . . $ dpp/::base64_encodecxx . . $ dpp/base64_encode(e95b56f114df2c56).(reinterpret_cast<unsigned char const *>("bc"), 2) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "YmM=" && |
| 262 | dppcxx . . $ dpp/::base64_encodecxx . . $ dpp/base64_encode(e95b56f114df2c56).(reinterpret_cast<unsigned char const *>("def"), 3) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ZGVm" && |
| 263 | dppcxx . . $ dpp/::base64_encodecxx . . $ dpp/base64_encode(e95b56f114df2c56).(reinterpret_cast<unsigned char const *>("ghij"), 4) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "Z2hpag==" && |
| 264 | dppcxx . . $ dpp/::base64_encodecxx . . $ dpp/base64_encode(e95b56f114df2c56).(reinterpret_cast<unsigned char const *>("klmno"), 5) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "a2xtbm8=" && |
| 265 | dppcxx . . $ dpp/::base64_encodecxx . . $ dpp/base64_encode(e95b56f114df2c56).(reinterpret_cast<unsigned char const *>("pqrstu"), 6) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "cHFyc3R1" && |
| 266 | dppcxx . . $ dpp/::base64_encodecxx . . $ dpp/base64_encode(e95b56f114df2c56).(reinterpret_cast<unsigned char const *>("vwxyz12"), 7) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "dnd4eXoxMg==" |
| 267 | ); |
| 268 | |
| 269 | dppcxx . . $ dpp/::http_connect_infocxx . . $ dpp/http_connect_info# hci; |
| 270 | set_testcxx . . $ set_test(c715a584a48bbbaa).(HOSTINFOcxx . . $ HOSTINFO., false); |
| 271 | |
| 272 | hci =cxx . . $ dpp/http_connect_info#`operator=`(f406aad101c839dd). dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#::get_host_infocxx . . $ dpp/https_client#get_host_info(700b74fc73ff9c9).("https://test.com:444"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 273 | bool hci_test = (hci.schemecxx . . $ dpp/http_connect_info#scheme. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https" && hci.hostnamecxx . . $ dpp/http_connect_info#hostname. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test.com" && hci.portcxx . . $ dpp/http_connect_info#port. == 444 && hci.is_sslcxx . . $ dpp/http_connect_info#is_ssl. == true); |
| 274 | |
| 275 | hci =cxx . . $ dpp/http_connect_info#`operator=`(f406aad101c839dd). dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#::get_host_infocxx . . $ dpp/https_client#get_host_info(700b74fc73ff9c9).("https://test.com"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 276 | hci_test = hci_test && (hci.schemecxx . . $ dpp/http_connect_info#scheme. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https" && hci.hostnamecxx . . $ dpp/http_connect_info#hostname. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test.com" && hci.portcxx . . $ dpp/http_connect_info#port. == 443 && hci.is_sslcxx . . $ dpp/http_connect_info#is_ssl. == true); |
| 277 | |
| 278 | hci =cxx . . $ dpp/http_connect_info#`operator=`(f406aad101c839dd). dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#::get_host_infocxx . . $ dpp/https_client#get_host_info(700b74fc73ff9c9).("http://test.com"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 279 | hci_test = hci_test && (hci.schemecxx . . $ dpp/http_connect_info#scheme. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "http" && hci.hostnamecxx . . $ dpp/http_connect_info#hostname. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test.com" && hci.portcxx . . $ dpp/http_connect_info#port. == 80 && hci.is_sslcxx . . $ dpp/http_connect_info#is_ssl. == false); |
| 280 | |
| 281 | hci =cxx . . $ dpp/http_connect_info#`operator=`(f406aad101c839dd). dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#::get_host_infocxx . . $ dpp/https_client#get_host_info(700b74fc73ff9c9).("http://test.com:90"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 282 | hci_test = hci_test && (hci.schemecxx . . $ dpp/http_connect_info#scheme. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "http" && hci.hostnamecxx . . $ dpp/http_connect_info#hostname. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test.com" && hci.portcxx . . $ dpp/http_connect_info#port. == 90 && hci.is_sslcxx . . $ dpp/http_connect_info#is_ssl. == false); |
| 283 | |
| 284 | hci =cxx . . $ dpp/http_connect_info#`operator=`(f406aad101c839dd). dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#::get_host_infocxx . . $ dpp/https_client#get_host_info(700b74fc73ff9c9).("test.com:97"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 285 | hci_test = hci_test && (hci.schemecxx . . $ dpp/http_connect_info#scheme. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "http" && hci.hostnamecxx . . $ dpp/http_connect_info#hostname. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test.com" && hci.portcxx . . $ dpp/http_connect_info#port. == 97 && hci.is_sslcxx . . $ dpp/http_connect_info#is_ssl. == false); |
| 286 | |
| 287 | hci =cxx . . $ dpp/http_connect_info#`operator=`(f406aad101c839dd). dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#::get_host_infocxx . . $ dpp/https_client#get_host_info(700b74fc73ff9c9).("test.com"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 288 | hci_test = hci_test && (hci.schemecxx . . $ dpp/http_connect_info#scheme. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "http" && hci.hostnamecxx . . $ dpp/http_connect_info#hostname. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test.com" && hci.portcxx . . $ dpp/http_connect_info#port. == 80 && hci.is_sslcxx . . $ dpp/http_connect_info#is_ssl. == false); |
| 289 | |
| 290 | set_testcxx . . $ set_test(c715a584a48bbbaa).(HOSTINFOcxx . . $ HOSTINFO., hci_test); |
| 291 | |
| 292 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<uint8_tcxx . . $ uint8_t#> testaudio = load_test_audiocxx . . $ load_test_audio(695134cc693f8bd0).(); |
| 293 | |
| 294 | set_testcxx . . $ set_test(c715a584a48bbbaa).(READFILEcxx . . $ READFILE., false); |
| 295 | stdcxx . . $ std/::stringcxx . . $ std/string# rf_test = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::read_filecxx . . $ dpp/utility/read_file(fd626fc03107dd24).(SHARED_OBJECTcxx . . $ `src/unittest/test.h:37:9`!); |
| 296 | FILEcxx . . $ FILE# *fp = fopen(SHARED_OBJECTcxx . . $ `src/unittest/test.h:37:9`!, "rb"); |
| 297 | fseek(fp, 0, SEEK_ENDcxx . . $ `<external>/14710646456994434043/fcntl.h:139:10`!); |
| 298 | size_t off = (size_t) ftell(fp); |
| 299 | fclose(fp); |
| 300 | set_testcxx . . $ set_test(c715a584a48bbbaa).(READFILEcxx . . $ READFILE., off == rf_test.lengthcxx . . $ std/__cxx11/basic_string#length(7e80fff40d76986b).()); |
| 301 | |
| 302 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMESTAMPTOSTRINGcxx . . $ TIMESTAMPTOSTRING., false); |
| 303 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMESTAMPTOSTRINGcxx . . $ TIMESTAMPTOSTRING., dppcxx . . $ dpp/::ts_to_stringcxx . . $ dpp/ts_to_string(2c88ed78ff9aa4cf).(1642611864) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "2022-01-19T17:04:24Z"); |
| 304 | |
| 305 | { |
| 306 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_COMPAREcxx . . $ ROLE_COMPARE., false); |
| 307 | dppcxx . . $ dpp/::rolecxx . . $ dpp/role# role_1cxx . . $ dpp/role#role(49f6e7a06ebc5aa8)., role_2cxx . . $ dpp/role#role(49f6e7a06ebc5aa8).; |
| 308 | role_1.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 99; |
| 309 | role_1.positioncxx . . $ dpp/role#position. = 1; |
| 310 | role_1.guild_idcxx . . $ dpp/role#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 123; |
| 311 | role_1.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 98; |
| 312 | role_2.positioncxx . . $ dpp/role#position. = 2; |
| 313 | role_2.guild_idcxx . . $ dpp/role#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 123; |
| 314 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_COMPAREcxx . . $ ROLE_COMPARE., role_1 <cxx . . $ dpp/`operator<`(3e073ce88997c0a6). role_2 && !(role_1 >cxx . . $ dpp/`operator>`(3e073ce88997c0a6). role_2) && role_1 !=cxx . . $ dpp/role#`operator!=`(f0d7e89fbc76f5eb). role_2); |
| 315 | } |
| 316 | { |
| 317 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_COMPARE_CONSIDERING_IDcxx . . $ ROLE_COMPARE_CONSIDERING_ID., false); |
| 318 | dppcxx . . $ dpp/::rolecxx . . $ dpp/role# role_1cxx . . $ dpp/role#role(49f6e7a06ebc5aa8)., role_2cxx . . $ dpp/role#role(49f6e7a06ebc5aa8).; |
| 319 | role_1.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 99; |
| 320 | role_1.positioncxx . . $ dpp/role#position. = 2; |
| 321 | role_1.guild_idcxx . . $ dpp/role#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 123; |
| 322 | role_2.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 98; |
| 323 | role_2.positioncxx . . $ dpp/role#position. = 2; |
| 324 | role_2.guild_idcxx . . $ dpp/role#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 123; |
| 325 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_COMPARE_CONSIDERING_IDcxx . . $ ROLE_COMPARE_CONSIDERING_ID., role_1 <cxx . . $ dpp/`operator<`(3e073ce88997c0a6). role_2 && !(role_1 >cxx . . $ dpp/`operator>`(3e073ce88997c0a6). role_2)); |
| 326 | } |
| 327 | |
| 328 | set_testcxx . . $ set_test(c715a584a48bbbaa).(WEBHOOKcxx . . $ WEBHOOK., false); |
| 329 | try { |
| 330 | dppcxx . . $ dpp/::webhookcxx . . $ dpp/webhook# test_whcxx . . $ dpp/webhook#webhook(9c546c94e5fcce4e).("https://discord.com/api/webhooks/833047646548133537/ntCHEYYIoHSLy_GOxPx6pmM0sUoLbP101ct-WI6F-S4beAV2vaIcl_Id5loAMyQwxqhE"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 331 | set_testcxx . . $ set_test(c715a584a48bbbaa).(WEBHOOKcxx . . $ WEBHOOK., (test_wh.tokencxx . . $ dpp/webhook#token. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ntCHEYYIoHSLy_GOxPx6pmM0sUoLbP101ct-WI6F-S4beAV2vaIcl_Id5loAMyQwxqhE") && (test_wh.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake#(833047646548133537))); |
| 332 | } |
| 333 | catch (const dppcxx . . $ dpp/::exceptioncxx . . $ dpp/exception# &) { |
| 334 | set_testcxx . . $ set_test(c715a584a48bbbaa).(WEBHOOKcxx . . $ WEBHOOK., false); |
| 335 | } |
| 336 | |
| 337 | { // test dpp::snowflake |
| 338 | start_testcxx . . $ start_test(271d3161c6a64dec).(SNOWFLAKEcxx . . $ SNOWFLAKE.); |
| 339 | bool success = true; |
| 340 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# s = 69420cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).; |
| 341 | jsoncxx . . $ json# jcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(6d988fd07f070dfc).; |
| 342 | j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."value"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). s; |
| 343 | success = dppcxx . . $ dpp/::snowflake_not_nullcxx . . $ dpp/snowflake_not_null(ada5243d35b97f74).(&j, "value") == 69420 && success; |
| 344 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(SNOWFLAKE, dpp::snowflake, success); |
| 345 | s =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 42069; |
| 346 | success = success && (s ==cxx . . $ dpp/snowflake#`operator==`(b276817fac6c20d5). 42069 && s ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). dppcxx . . $ dpp/snowflake#snowflake(45405682577da2e6).::snowflakecxx . . $ dpp/snowflake#{42069} && s ==cxx . . $ dpp/snowflake#`operator==`(d491d027108183dc). "42069"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 347 | success = success && (dppcxx . . $ dpp/snowflake#snowflake(45405682577da2e6).::snowflakecxx . . $ dpp/snowflake#{69} < dppcxx . . $ dpp/snowflake#snowflake(45405682577da2e6).::snowflakecxx . . $ dpp/snowflake#{420} && (dppcxx . . $ dpp/snowflake#snowflake(45405682577da2e6).::snowflakecxx . . $ dpp/snowflake#{69} < 420)); |
| 348 | s =cxx . . $ dpp/snowflake#`operator=`(43eff3dc5e397af5). "69420"; |
| 349 | success = success && s ==cxx . . $ dpp/snowflake#`operator==`(b276817fac6c20d5). 69420; |
| 350 | auto conversion_test = [](dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# sl) { |
| 351 | return sl.strcxx . . $ dpp/snowflake#str(219584694fe2b248).(); |
| 352 | }; |
| 353 | s =cxx . . $ dpp/snowflake#`operator=`(43eff3dc5e397af5). conversion_test(cxx . . $ main(afcd3168fc1188a4).$anonymous_type_0#`operator()`(acb7fc1dd6f044c2).stdcxx . . $ dpp/snowflake#snowflake(80d8335016fb1bdc).::stringcxx . . $ std/string#{"1337"}); |
| 354 | success = success && s ==cxx . . $ dpp/snowflake#`operator==`(b276817fac6c20d5). 1337; /* THIS BREAKS (and i do not care very much): && s == conversion_test(dpp::snowflake{"1337"}); */ |
| 355 | success = success && dppcxx . . $ dpp/snowflake#snowflake(45405682577da2e6).::snowflakecxx . . $ dpp/snowflake#{0} ==cxx . . $ dpp/snowflake#`operator==`(b276817fac6c20d5). 0; |
| 356 | set_testcxx . . $ set_test(c715a584a48bbbaa).(SNOWFLAKEcxx . . $ SNOWFLAKE., success); |
| 357 | } |
| 358 | |
| 359 | { // test snowflake: std::format support |
| 360 | |
| 361 | #ifdef DPP_FORMATTERS |
| 362 | set_test(SNOWFLAKE_STD_FORMAT, |
| 363 | std::format("{}",dpp::snowflake{}) == "0" && |
| 364 | std::format("{}",dpp::snowflake{12345}) == "12345" && |
| 365 | std::format("{} hello {}", dpp::snowflake{12345}, dpp::snowflake{54321}) == "12345 hello 54321" |
| 366 | ); |
| 367 | #else |
| 368 | set_statuscxx . . $ set_status(69213411294ab03e).(SNOWFLAKE_STD_FORMATcxx . . $ SNOWFLAKE_STD_FORMAT., ts_skippedcxx . . $ ts_skipped.); |
| 369 | #endif // DPP_FORMATTERS |
| 370 | }; |
| 371 | |
| 372 | { // test dpp::json_interface |
| 373 | start_testcxx . . $ start_test(271d3161c6a64dec).(JSON_INTERFACEcxx . . $ JSON_INTERFACE.); |
| 374 | struct fillablecxx . . $ main(afcd3168fc1188a4).fillable# : dppcxx . . $ dpp/::json_interfacecxx . . $ dpp/json_interface#<fillablecxx . . $ main(afcd3168fc1188a4).fillable#> { |
| 375 | fillablecxx . . $ main(afcd3168fc1188a4).fillable# &fill_from_json_implcxx . . $ main(afcd3168fc1188a4).fillable#fill_from_json_impl(63bcb4b3a79d7f9e).(dppcxx . . $ dpp/::jsoncxx . . $ dpp/json# *) { |
| 376 | return *this; |
| 377 | } |
| 378 | }; |
| 379 | struct buildablecxx . . $ main(afcd3168fc1188a4).buildable# : dppcxx . . $ dpp/::json_interfacecxx . . $ dpp/json_interface#<buildablecxx . . $ main(afcd3168fc1188a4).buildable#> { |
| 380 | jsoncxx . . $ json# to_json_implcxx . . $ main(afcd3168fc1188a4).buildable#to_json_impl(c45180a0dc2708f9).(bool = false) const { |
| 381 | return {cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(6d988fd07f070dfc).}; |
| 382 | } |
| 383 | }; |
| 384 | struct fillable_and_buildablecxx . . $ main(afcd3168fc1188a4).fillable_and_buildable# : dppcxx . . $ dpp/::json_interfacecxx . . $ dpp/json_interface#<fillable_and_buildablecxx . . $ main(afcd3168fc1188a4).fillable_and_buildable#> { |
| 385 | fillable_and_buildablecxx . . $ main(afcd3168fc1188a4).fillable_and_buildable# &fill_from_json_implcxx . . $ main(afcd3168fc1188a4).fillable_and_buildable#fill_from_json_impl(2112c76c3fa4eac5).(dppcxx . . $ dpp/::jsoncxx . . $ dpp/json# *) { |
| 386 | return *this; |
| 387 | } |
| 388 | |
| 389 | jsoncxx . . $ json# to_json_implcxx . . $ main(afcd3168fc1188a4).fillable_and_buildable#to_json_impl(c45180a0dc2708f9).(bool = false) const { |
| 390 | return {cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(6d988fd07f070dfc).}; |
| 391 | } |
| 392 | }; |
| 393 | bool success = true; |
| 394 | |
| 395 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_build_json_v<dpp::json_interface<buildable>>, success); |
| 396 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, !has_fill_from_json_v<dpp::json_interface<buildable>>, success); |
| 397 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_build_json_v<buildable>, success); |
| 398 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, !has_fill_from_json_v<buildable>, success); |
| 399 | |
| 400 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, !has_build_json_v<dpp::json_interface<fillable>>, success); |
| 401 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_fill_from_json_v<dpp::json_interface<fillable>>, success); |
| 402 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, !has_build_json_v<fillable>, success); |
| 403 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_fill_from_json_v<fillable>, success); |
| 404 | |
| 405 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_build_json_v<dpp::json_interface<fillable_and_buildable>>, success); |
| 406 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_fill_from_json_v<dpp::json_interface<fillable_and_buildable>>, success); |
| 407 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_build_json_v<fillable_and_buildable>, success); |
| 408 | DPP_CHECKcxx . . $ `src/unittest/test.h:577:9`!(JSON_INTERFACE, has_fill_from_json_v<fillable_and_buildable>, success); |
| 409 | set_testcxx . . $ set_test(c715a584a48bbbaa).(JSON_INTERFACEcxx . . $ JSON_INTERFACE., success); |
| 410 | } |
| 411 | |
| 412 | { // test interaction_create_t::get_parameter |
| 413 | // create a fake interaction |
| 414 | dppcxx . . $ dpp/::clustercxx . . $ dpp/cluster# clustercxx . . $ dpp/cluster#cluster(13cb741d36ace229).(""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 415 | dppcxx . . $ dpp/::discord_clientcxx . . $ dpp/discord_client# clientcxx . . $ dpp/discord_client#discord_client(39210715add7299e).(&cluster, 1, 1, ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 416 | dppcxx . . $ dpp/::interaction_create_tcxx . . $ dpp/interaction_create_t# interaction(nullptr, 0, ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 417 | |
| 418 | /* Check the method with subcommands */ |
| 419 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GET_PARAMETER_WITH_SUBCOMMANDScxx . . $ GET_PARAMETER_WITH_SUBCOMMANDS., false); |
| 420 | |
| 421 | dppcxx . . $ dpp/::command_interactioncxx . . $ dpp/command_interaction# cmd_data; // command |
| 422 | cmd_data.typecxx . . $ dpp/command_interaction#type. = dppcxx . . $ dpp/::ctxm_chat_inputcxx . . $ dpp/ctxm_chat_input.; |
| 423 | cmd_data.namecxx . . $ dpp/command_interaction#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "command"; |
| 424 | |
| 425 | dppcxx . . $ dpp/::command_data_optioncxx . . $ dpp/command_data_option# subcommandgroup; // subcommand group |
| 426 | subcommandgroup.namecxx . . $ dpp/command_data_option#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "group"; |
| 427 | subcommandgroup.typecxx . . $ dpp/command_data_option#type. = dppcxx . . $ dpp/::co_sub_command_groupcxx . . $ dpp/co_sub_command_group.; |
| 428 | |
| 429 | dppcxx . . $ dpp/::command_data_optioncxx . . $ dpp/command_data_option# subcommand; // subcommand |
| 430 | subcommand.namecxx . . $ dpp/command_data_option#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "add"; |
| 431 | subcommand.typecxx . . $ dpp/command_data_option#type. = dppcxx . . $ dpp/::co_sub_commandcxx . . $ dpp/co_sub_command.; |
| 432 | |
| 433 | dppcxx . . $ dpp/::command_data_optioncxx . . $ dpp/command_data_option# option1; // slashcommand option |
| 434 | option1.namecxx . . $ dpp/command_data_option#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "user"; |
| 435 | option1.typecxx . . $ dpp/command_data_option#type. = dppcxx . . $ dpp/::co_usercxx . . $ dpp/co_user.; |
| 436 | option1.valuecxx . . $ dpp/command_data_option#value. =cxx . . $ std/variant#`operator=`(2aa1a927971a6116). dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake#(189759562910400512); |
| 437 | |
| 438 | dppcxx . . $ dpp/::command_data_optioncxx . . $ dpp/command_data_option# option2; // slashcommand option |
| 439 | option2.namecxx . . $ dpp/command_data_option#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "checked"; |
| 440 | option2.typecxx . . $ dpp/command_data_option#type. = dppcxx . . $ dpp/::co_booleancxx . . $ dpp/co_boolean.; |
| 441 | option2.valuecxx . . $ dpp/command_data_option#value. =cxx . . $ std/variant#`operator=`(2aa1a927971a6116). true; |
| 442 | |
| 443 | // add them |
| 444 | subcommand.optionscxx . . $ dpp/command_data_option#options..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(option1); |
| 445 | subcommand.optionscxx . . $ dpp/command_data_option#options..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(option2); |
| 446 | subcommandgroup.optionscxx . . $ dpp/command_data_option#options..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(subcommand); |
| 447 | cmd_data.optionscxx . . $ dpp/command_interaction#options..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(subcommandgroup); |
| 448 | interaction.commandcxx . . $ dpp/interaction_create_t#command..datacxx . . $ dpp/interaction#data. =cxx . . $ std/variant#`operator=`(2aa1a927971a6116). cmd_data; |
| 449 | |
| 450 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# value1 = stdcxx . . $ dpp/snowflake#snowflake(e05a5aa9c7d5882c).::getcxx . . $ std/get(e13ef601cb0b8457).<dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake#>(interaction.get_parametercxx . . $ dpp/interaction_create_t#get_parameter(ee6112af906fcbe).("user"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)); |
| 451 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GET_PARAMETER_WITH_SUBCOMMANDScxx . . $ GET_PARAMETER_WITH_SUBCOMMANDS., value1 ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake#(189759562910400512)); |
| 452 | |
| 453 | /* Check the method without subcommands */ |
| 454 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GET_PARAMETER_WITHOUT_SUBCOMMANDScxx . . $ GET_PARAMETER_WITHOUT_SUBCOMMANDS., false); |
| 455 | |
| 456 | dppcxx . . $ dpp/::command_interactioncxx . . $ dpp/command_interaction# cmd_data2; // command |
| 457 | cmd_data2.typecxx . . $ dpp/command_interaction#type. = dppcxx . . $ dpp/::ctxm_chat_inputcxx . . $ dpp/ctxm_chat_input.; |
| 458 | cmd_data2.namecxx . . $ dpp/command_interaction#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "command"; |
| 459 | |
| 460 | dppcxx . . $ dpp/::command_data_optioncxx . . $ dpp/command_data_option# option3; // slashcommand option |
| 461 | option3.namecxx . . $ dpp/command_data_option#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "number"; |
| 462 | option3.typecxx . . $ dpp/command_data_option#type. = dppcxx . . $ dpp/::co_integercxx . . $ dpp/co_integer.; |
| 463 | option3.valuecxx . . $ dpp/command_data_option#value. =cxx . . $ std/variant#`operator=`(2aa1a927971a6116). int64_t(123456); |
| 464 | |
| 465 | cmd_data2.optionscxx . . $ dpp/command_interaction#options..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(option3); |
| 466 | interaction.commandcxx . . $ dpp/interaction_create_t#command..datacxx . . $ dpp/interaction#data. =cxx . . $ std/variant#`operator=`(2aa1a927971a6116). cmd_data2; |
| 467 | |
| 468 | int64_t value2 = stdcxx . . $ std/::getcxx . . $ std/get(e13ef601cb0b8457).<int64_t>(interaction.get_parametercxx . . $ dpp/interaction_create_t#get_parameter(ee6112af906fcbe).("number"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)); |
| 469 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GET_PARAMETER_WITHOUT_SUBCOMMANDScxx . . $ GET_PARAMETER_WITHOUT_SUBCOMMANDS., value2 == 123456); |
| 470 | } |
| 471 | |
| 472 | { // test dpp::command_option_choice::fill_from_json |
| 473 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_DOUBLEcxx . . $ OPTCHOICE_DOUBLE., false); |
| 474 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_INTcxx . . $ OPTCHOICE_INT., false); |
| 475 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_BOOLcxx . . $ OPTCHOICE_BOOL., false); |
| 476 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_SNOWFLAKEcxx . . $ OPTCHOICE_SNOWFLAKE., false); |
| 477 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_STRINGcxx . . $ OPTCHOICE_STRING., false); |
| 478 | jsoncxx . . $ json# jcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(6d988fd07f070dfc).; |
| 479 | dppcxx . . $ dpp/::command_option_choicecxx . . $ dpp/command_option_choice# choicecxx . . $ dpp/command_option_choice#command_option_choice(ced63f7c635d850d).; |
| 480 | j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."value"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). 54.321cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).; |
| 481 | choice.fill_from_jsoncxx . . $ dpp/json_interface#fill_from_json(a8904c0342117f8d).(&j); |
| 482 | bool success_double = stdcxx . . $ std/::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<double>(choice.valuecxx . . $ dpp/command_option_choice#value.); |
| 483 | j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."value"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). 8223372036854775807cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).; |
| 484 | choice.fill_from_jsoncxx . . $ dpp/json_interface#fill_from_json(a8904c0342117f8d).(&j); |
| 485 | bool success_int = stdcxx . . $ std/::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<int64_t>(choice.valuecxx . . $ dpp/command_option_choice#value.); |
| 486 | j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."value"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). -cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).8223372036854775807; |
| 487 | choice.fill_from_jsoncxx . . $ dpp/json_interface#fill_from_json(a8904c0342117f8d).(&j); |
| 488 | bool success_int2 = stdcxx . . $ std/::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<int64_t>(choice.valuecxx . . $ dpp/command_option_choice#value.); |
| 489 | j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."value"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). truecxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).; |
| 490 | choice.fill_from_jsoncxx . . $ dpp/json_interface#fill_from_json(a8904c0342117f8d).(&j); |
| 491 | bool success_bool = stdcxx . . $ std/::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<bool>(choice.valuecxx . . $ dpp/command_option_choice#value.); |
| 492 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# scxx . . $ dpp/snowflake#snowflake(45405682577da2e6).(845266178036516757); // example snowflake |
| 493 | j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."value"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). s; |
| 494 | choice.fill_from_jsoncxx . . $ dpp/json_interface#fill_from_json(a8904c0342117f8d).(&j); |
| 495 | bool success_snowflake = stdcxx . . $ std/::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake#>(choice.valuecxx . . $ dpp/command_option_choice#value.) && stdcxx . . $ std/::getcxx . . $ std/get(55ed64a6518b24d0).<dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake#>(choice.valuecxx . . $ dpp/command_option_choice#value.) ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). scxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).; |
| 496 | j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."value"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). "foobar"cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).; |
| 497 | choice.fill_from_jsoncxx . . $ dpp/json_interface#fill_from_json(a8904c0342117f8d).(&j); |
| 498 | bool success_string = stdcxx . . $ std/::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<stdcxx . . $ std/::stringcxx . . $ std/string#>(choice.valuecxx . . $ dpp/command_option_choice#value.); |
| 499 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_DOUBLEcxx . . $ OPTCHOICE_DOUBLE., success_double); |
| 500 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_INTcxx . . $ OPTCHOICE_INT., success_int && success_int2); |
| 501 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_BOOLcxx . . $ OPTCHOICE_BOOL., success_bool); |
| 502 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_SNOWFLAKEcxx . . $ OPTCHOICE_SNOWFLAKE., success_snowflake); |
| 503 | set_testcxx . . $ set_test(c715a584a48bbbaa).(OPTCHOICE_STRINGcxx . . $ OPTCHOICE_STRING., success_string); |
| 504 | } |
| 505 | |
| 506 | { |
| 507 | set_testcxx . . $ set_test(c715a584a48bbbaa).(PERMISSION_CLASScxx . . $ PERMISSION_CLASS., false); |
| 508 | bool success = false; |
| 509 | auto p = dppcxx . . $ dpp/permission#permission(ced63f7c635d850d).::permissioncxx . . $ dpp/permission#(); |
| 510 | p =cxx . . $ dpp/permission#`operator=`(2fe5b1dc0d11f4e1). 16cxx . . $ dpp/permission#permission(203741fbd813a59e).; |
| 511 | success = p == 16; |
| 512 | p |= 4; |
| 513 | success = p == 20 && success; |
| 514 | p <<= 8; // left shift |
| 515 | success = p == 5120 && success; |
| 516 | auto s = stdcxx . . $ std/::to_stringcxx . . $ std/__cxx11/to_string(354ce04007c9ea85).(p); |
| 517 | success = s ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "5120" && success; |
| 518 | p.setcxx . . $ dpp/permission#set(8250ce5853a47440).(0).addcxx . . $ dpp/permission#add(8250ce5853a47440).(~uint64_tcxx . . $ uint64_t#{0}).removecxx . . $ dpp/permission#remove(8250ce5853a47440).(dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak.).setcxx . . $ dpp/permission#set(8250ce5853a47440).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator.); |
| 519 | success = !p.hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator., dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; // must return false because they're not both set |
| 520 | success = !p.hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator. | dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 521 | success = p.cancxx . . $ dpp/permission#can(f3322f0345833e74).(dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 522 | success = p.cancxx . . $ dpp/permission#can(f3322f0345833e74).(dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak.) && success; |
| 523 | |
| 524 | constexpr auto permission_test = [](dppcxx . . $ dpp/::permissioncxx . . $ dpp/permission# p) constexpr noexcept { |
| 525 | bool success{true}; |
| 526 | |
| 527 | p.setcxx . . $ dpp/permission#set(8250ce5853a47440).(0).addcxx . . $ dpp/permission#add(8250ce5853a47440).(~uint64_tcxx . . $ uint64_t#{0}).removecxx . . $ dpp/permission#remove(8250ce5853a47440).(dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak.).setcxx . . $ dpp/permission#set(8250ce5853a47440).(dppcxx . . $ dpp/::p_connectcxx . . $ dpp/p_connect.); |
| 528 | p.setcxx . . $ dpp/permission#set(8250ce5853a47440).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator., dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.); |
| 529 | success = p.hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator.) && success; |
| 530 | success = p.hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator.) && p.hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 531 | success = p.hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator., dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 532 | success = p.hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator. | dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 533 | success = p.addcxx . . $ dpp/permission#add(8250ce5853a47440).(dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak.).hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator., dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak.) && success; |
| 534 | success = !p.removecxx . . $ dpp/permission#remove(8250ce5853a47440).(dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak.).hascxx . . $ dpp/permission#has(f3322f0345833e74).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator., dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak.) && success; |
| 535 | p.removecxx . . $ dpp/permission#remove(8250ce5853a47440).(dppcxx . . $ dpp/::p_administratorcxx . . $ dpp/p_administrator.); |
| 536 | success = p.cancxx . . $ dpp/permission#can(f3322f0345833e74).(dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 537 | success = !p.cancxx . . $ dpp/permission#can(f3322f0345833e74).(dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak., dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 538 | success = p.can_anycxx . . $ dpp/permission#can_any(f3322f0345833e74).(dppcxx . . $ dpp/::p_speakcxx . . $ dpp/p_speak., dppcxx . . $ dpp/::p_ban_memberscxx . . $ dpp/p_ban_members.) && success; |
| 539 | return success; |
| 540 | }; |
| 541 | constexpr auto constexpr_success = permission_test(cxx . . $ main(afcd3168fc1188a4).$anonymous_type_1#`operator()`(24ba9c6102c99863).{cxx . . $ dpp/permission#permission(203741fbd813a59e).~uint64_tcxx . . $ uint64_t#{0}}); // test in constant evaluated |
| 542 | success = permission_test(cxx . . $ main(afcd3168fc1188a4).$anonymous_type_1#`operator()`(24ba9c6102c99863).{cxx . . $ dpp/permission#permission(203741fbd813a59e).~uint64_tcxx . . $ uint64_t#{0}}) && constexpr_success && success; // test at runtime |
| 543 | set_testcxx . . $ set_test(c715a584a48bbbaa).(PERMISSION_CLASScxx . . $ PERMISSION_CLASS., success); |
| 544 | } |
| 545 | |
| 546 | { // dpp event classes |
| 547 | start_testcxx . . $ start_test(271d3161c6a64dec).(EVENT_CLASScxx . . $ EVENT_CLASS.); |
| 548 | bool success = true; |
| 549 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::log_t, success); |
| 550 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_scheduled_event_user_add_t, success); |
| 551 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_scheduled_event_user_remove_t, success); |
| 552 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_scheduled_event_create_t, success); |
| 553 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_scheduled_event_update_t, success); |
| 554 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_scheduled_event_delete_t, success); |
| 555 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::automod_rule_create_t, success); |
| 556 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::automod_rule_update_t, success); |
| 557 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::automod_rule_delete_t, success); |
| 558 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::automod_rule_execute_t, success); |
| 559 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::stage_instance_create_t, success); |
| 560 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::stage_instance_update_t, success); |
| 561 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::stage_instance_delete_t, success); |
| 562 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_channel_effect_send_t, success); |
| 563 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_state_update_t, success); |
| 564 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::interaction_create_t, success); |
| 565 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::slashcommand_t, success); |
| 566 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::button_click_t, success); |
| 567 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::form_submit_t, success); |
| 568 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::autocomplete_t, success); |
| 569 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::context_menu_t, success); |
| 570 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_context_menu_t, success); |
| 571 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::user_context_menu_t, success); |
| 572 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::select_click_t, success); |
| 573 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_delete_t, success); |
| 574 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_stickers_update_t, success); |
| 575 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_join_request_delete_t, success); |
| 576 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::channel_delete_t, success); |
| 577 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::channel_update_t, success); |
| 578 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::ready_t, success); |
| 579 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_delete_t, success); |
| 580 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_member_remove_t, success); |
| 581 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::resumed_t, success); |
| 582 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_role_create_t, success); |
| 583 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::typing_start_t, success); |
| 584 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_track_marker_t, success); |
| 585 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_reaction_add_t, success); |
| 586 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_members_chunk_t, success); |
| 587 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_reaction_remove_t, success); |
| 588 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_create_t, success); |
| 589 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::channel_create_t, success); |
| 590 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_reaction_remove_emoji_t, success); |
| 591 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_delete_bulk_t, success); |
| 592 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_role_update_t, success); |
| 593 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_role_delete_t, success); |
| 594 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::channel_pins_update_t, success); |
| 595 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_reaction_remove_all_t, success); |
| 596 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_server_update_t, success); |
| 597 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_emojis_update_t, success); |
| 598 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::presence_update_t, success); |
| 599 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::webhooks_update_t, success); |
| 600 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_member_add_t, success); |
| 601 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::invite_delete_t, success); |
| 602 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_update_t, success); |
| 603 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_integrations_update_t, success); |
| 604 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_member_update_t, success); |
| 605 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::invite_create_t, success); |
| 606 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_update_t, success); |
| 607 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::user_update_t, success); |
| 608 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::message_create_t, success); |
| 609 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_audit_log_entry_create_t, success); |
| 610 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_ban_add_t, success); |
| 611 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::guild_ban_remove_t, success); |
| 612 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::integration_create_t, success); |
| 613 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::integration_update_t, success); |
| 614 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::integration_delete_t, success); |
| 615 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::thread_create_t, success); |
| 616 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::thread_update_t, success); |
| 617 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::thread_delete_t, success); |
| 618 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::thread_list_sync_t, success); |
| 619 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::thread_member_update_t, success); |
| 620 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::thread_members_update_t, success); |
| 621 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_buffer_send_t, success); |
| 622 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_ready_t, success); |
| 623 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_receive_t, success); |
| 624 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_client_speaking_t, success); |
| 625 | DPP_CHECK_CONSTRUCT_ASSIGNcxx . . $ `src/unittest/test.h:582:9`!(EVENT_CLASS, dpp::voice_client_disconnect_t, success); |
| 626 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EVENT_CLASScxx . . $ EVENT_CLASS., success); |
| 627 | } |
| 628 | |
| 629 | |
| 630 | { // some dpp::user methods |
| 631 | dppcxx . . $ dpp/::usercxx . . $ dpp/user# user1cxx . . $ dpp/user#user(49f6e7a06ebc5aa8).; |
| 632 | user1.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 189759562910400512; |
| 633 | user1.discriminatorcxx . . $ dpp/user#discriminator. = 0001; |
| 634 | user1.usernamecxx . . $ dpp/user#username. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "brain"; |
| 635 | |
| 636 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_MENTIONcxx . . $ USER_GET_MENTION., false); |
| 637 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_MENTIONcxx . . $ USER_GET_MENTION., user1.get_mentioncxx . . $ dpp/user#get_mention(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<@189759562910400512>"); |
| 638 | |
| 639 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_FORMAT_USERNAMEcxx . . $ USER_FORMAT_USERNAME., false); |
| 640 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_FORMAT_USERNAMEcxx . . $ USER_FORMAT_USERNAME., user1.format_usernamecxx . . $ dpp/user#format_username(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "brain#0001"); |
| 641 | |
| 642 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CREATION_TIMEcxx . . $ USER_GET_CREATION_TIME., false); |
| 643 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CREATION_TIMEcxx . . $ USER_GET_CREATION_TIME., (uint64_tcxx . . $ uint64_t#) user1.get_creation_timecxx . . $ dpp/managed#get_creation_time(d8440c0a87ad7443).() == 1465312605); |
| 644 | |
| 645 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_URLcxx . . $ USER_GET_URL., false); |
| 646 | |
| 647 | dppcxx . . $ dpp/::usercxx . . $ dpp/user# user2cxx . . $ dpp/user#user(49f6e7a06ebc5aa8).; |
| 648 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_URLcxx . . $ USER_GET_URL., |
| 649 | user1.get_urlcxx . . $ dpp/user#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_hostcxx . . $ dpp/utility/url_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/users/189759562910400512" && |
| 650 | user2.get_urlcxx . . $ dpp/user#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" |
| 651 | ); |
| 652 | } |
| 653 | |
| 654 | { // avatar size function |
| 655 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_AVATAR_SIZEcxx . . $ UTILITY_AVATAR_SIZE., false); |
| 656 | bool success = false; |
| 657 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::avatar_sizecxx . . $ dpp/utility/avatar_size(8297fed3afd4179b).(0).emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).(); |
| 658 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::avatar_sizecxx . . $ dpp/utility/avatar_size(8297fed3afd4179b).(16) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "?size=16" && success; |
| 659 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::avatar_sizecxx . . $ dpp/utility/avatar_size(8297fed3afd4179b).(256) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "?size=256" && success; |
| 660 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::avatar_sizecxx . . $ dpp/utility/avatar_size(8297fed3afd4179b).(4096) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "?size=4096" && success; |
| 661 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::avatar_sizecxx . . $ dpp/utility/avatar_size(8297fed3afd4179b).(8192).emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && success; |
| 662 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::avatar_sizecxx . . $ dpp/utility/avatar_size(8297fed3afd4179b).(3000).emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && success; |
| 663 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_AVATAR_SIZEcxx . . $ UTILITY_AVATAR_SIZE., success); |
| 664 | } |
| 665 | |
| 666 | { // cdn endpoint url getter |
| 667 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_CDN_ENDPOINT_URL_HASHcxx . . $ UTILITY_CDN_ENDPOINT_URL_HASH., false); |
| 668 | bool success = false; |
| 669 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_jpgcxx . . $ dpp/i_jpg., 0).emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).(); |
| 670 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., 0) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/foobar/test.png" && success; |
| 671 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., 128) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/foobar/test.png?size=128" && success; |
| 672 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "12345"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif., 0, false, true) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/foobar/test/a_12345.gif" && success; |
| 673 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "12345"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., 0, false, true) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/foobar/test/a_12345.png" && success; |
| 674 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "12345"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., 0, false, false) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/foobar/test/12345.png" && success; |
| 675 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "12345"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., 0, true, true) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/foobar/test/a_12345.gif" && success; |
| 676 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., 0, true, true) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/foobar/test.gif" && success; |
| 677 | success = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_endpoint_url_hashcxx . . $ dpp/utility/cdn_endpoint_url_hash(a019ad8f24aa5459).({cxx . . $ std/vector#vector(9619226211e5a241).dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif.}, "foobar/test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif., 0, false, false).emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && success; |
| 678 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_CDN_ENDPOINT_URL_HASHcxx . . $ UTILITY_CDN_ENDPOINT_URL_HASH., success); |
| 679 | } |
| 680 | |
| 681 | { // sticker url getter |
| 682 | set_testcxx . . $ set_test(c715a584a48bbbaa).(STICKER_GET_URLcxx . . $ STICKER_GET_URL., false); |
| 683 | dppcxx . . $ dpp/::stickercxx . . $ dpp/sticker# scxx . . $ dpp/sticker#sticker(49f6e7a06ebc5aa8).; |
| 684 | s.format_typecxx . . $ dpp/sticker#format_type. = dppcxx . . $ dpp/::sf_pngcxx . . $ dpp/sf_png.; |
| 685 | bool success = s.get_urlcxx . . $ dpp/sticker#get_url(219584694fe2b248).().emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).(); |
| 686 | s.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 12345; |
| 687 | success = s.get_urlcxx . . $ dpp/sticker#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/stickers/12345.png" && success; |
| 688 | s.format_typecxx . . $ dpp/sticker#format_type. = dppcxx . . $ dpp/::sf_gifcxx . . $ dpp/sf_gif.; |
| 689 | success = s.get_urlcxx . . $ dpp/sticker#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/stickers/12345.gif" && success; |
| 690 | s.format_typecxx . . $ dpp/sticker#format_type. = dppcxx . . $ dpp/::sf_lottiecxx . . $ dpp/sf_lottie.; |
| 691 | success = s.get_urlcxx . . $ dpp/sticker#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://cdn.discordapp.com/stickers/12345.json" && success; |
| 692 | set_testcxx . . $ set_test(c715a584a48bbbaa).(STICKER_GET_URLcxx . . $ STICKER_GET_URL., success); |
| 693 | } |
| 694 | |
| 695 | { // user url getter |
| 696 | dppcxx . . $ dpp/::usercxx . . $ dpp/user# user1cxx . . $ dpp/user#user(49f6e7a06ebc5aa8).; |
| 697 | user1.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 189759562910400512; |
| 698 | user1.usernamecxx . . $ dpp/user#username. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "Brain"; |
| 699 | user1.discriminatorcxx . . $ dpp/user#discriminator. = 0001; |
| 700 | |
| 701 | auto user2 = user1; |
| 702 | user2.avatarcxx . . $ dpp/user#avatar. =cxx . . $ dpp/utility/iconhash#`operator=`(99b67a3c0324b6a8). "5532c6414c70765a28cf9448c117205f"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 703 | |
| 704 | auto user3 = user2; |
| 705 | user3.flagscxx . . $ dpp/user#flags. |= dppcxx . . $ dpp/::u_animated_iconcxx . . $ dpp/u_animated_icon.; |
| 706 | |
| 707 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_AVATAR_URLcxx . . $ USER_GET_AVATAR_URL., false); |
| 708 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_AVATAR_URLcxx . . $ USER_GET_AVATAR_URL., |
| 709 | dppcxx . . $ dpp/user#user(49f6e7a06ebc5aa8).::usercxx . . $ dpp/user#().get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).().emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && |
| 710 | user1.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/embed/avatars/1.png" && |
| 711 | user2.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/5532c6414c70765a28cf9448c117205f.png" && |
| 712 | user2.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).(0, dppcxx . . $ dpp/::i_webpcxx . . $ dpp/i_webp.) ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/5532c6414c70765a28cf9448c117205f.webp" && |
| 713 | user2.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).(0, dppcxx . . $ dpp/::i_jpgcxx . . $ dpp/i_jpg.) ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/5532c6414c70765a28cf9448c117205f.jpg" && |
| 714 | user3.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/a_5532c6414c70765a28cf9448c117205f.gif" && |
| 715 | user3.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).(4096, dppcxx . . $ dpp/::i_gifcxx . . $ dpp/i_gif.) ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/a_5532c6414c70765a28cf9448c117205f.gif?size=4096" && |
| 716 | user3.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).(512, dppcxx . . $ dpp/::i_webpcxx . . $ dpp/i_webp.) ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/a_5532c6414c70765a28cf9448c117205f.gif?size=512" && |
| 717 | user3.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).(512, dppcxx . . $ dpp/::i_jpgcxx . . $ dpp/i_jpg.) ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/a_5532c6414c70765a28cf9448c117205f.gif?size=512" && |
| 718 | user3.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).(16, dppcxx . . $ dpp/::i_jpgcxx . . $ dpp/i_jpg., false) ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/a_5532c6414c70765a28cf9448c117205f.jpg?size=16" && |
| 719 | user3.get_avatar_urlcxx . . $ dpp/user#get_avatar_url(a840917f06f86a96).(5000) ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/avatars/189759562910400512/a_5532c6414c70765a28cf9448c117205f.gif" |
| 720 | ); |
| 721 | } |
| 722 | |
| 723 | { // emoji url getter |
| 724 | dppcxx . . $ dpp/::emojicxx . . $ dpp/emoji# emojicxx . . $ dpp/emoji#emoji(ced63f7c635d850d).; |
| 725 | emoji.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825407338755653641; |
| 726 | |
| 727 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_GET_URLcxx . . $ EMOJI_GET_URL., false); |
| 728 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_GET_URLcxx . . $ EMOJI_GET_URL., emoji.get_urlcxx . . $ dpp/emoji#get_url(a840917f06f86a96).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::cdn_hostcxx . . $ dpp/utility/cdn_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/emojis/825407338755653641.png"); |
| 729 | } |
| 730 | |
| 731 | { // message methods |
| 732 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# mcxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 733 | m.guild_idcxx . . $ dpp/message#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825407338755653642; |
| 734 | m.channel_idcxx . . $ dpp/message#channel_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 956230231277072415; |
| 735 | m.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 1151617986541666386; |
| 736 | |
| 737 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m2cxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 738 | m2.guild_idcxx . . $ dpp/message#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825407338755653642; |
| 739 | m2.channel_idcxx . . $ dpp/message#channel_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 956230231277072415; |
| 740 | |
| 741 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m3cxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 742 | m3.guild_idcxx . . $ dpp/message#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825407338755653642; |
| 743 | m3.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 1151617986541666386; |
| 744 | |
| 745 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m4cxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 746 | m4.channel_idcxx . . $ dpp/message#channel_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 956230231277072415; |
| 747 | m4.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 1151617986541666386; |
| 748 | |
| 749 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m5cxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 750 | m5.guild_idcxx . . $ dpp/message#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825407338755653642; |
| 751 | |
| 752 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m6cxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 753 | m6.channel_idcxx . . $ dpp/message#channel_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 956230231277072415; |
| 754 | |
| 755 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m7cxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 756 | m7.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 1151617986541666386; |
| 757 | |
| 758 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m8cxx . . $ dpp/message#message(49f6e7a06ebc5aa8).; |
| 759 | |
| 760 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGE_GET_URLcxx . . $ MESSAGE_GET_URL., false); |
| 761 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGE_GET_URLcxx . . $ MESSAGE_GET_URL., |
| 762 | m.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_hostcxx . . $ dpp/utility/url_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/channels/825407338755653642/956230231277072415/1151617986541666386" && |
| 763 | m2.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 764 | m3.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 765 | m4.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 766 | m5.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 767 | m6.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 768 | m7.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 769 | m8.get_urlcxx . . $ dpp/message#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" |
| 770 | ); |
| 771 | } |
| 772 | |
| 773 | { // channel methods |
| 774 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNEL_SET_TYPEcxx . . $ CHANNEL_SET_TYPE., false); |
| 775 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# ccxx . . $ dpp/channel#channel(49f6e7a06ebc5aa8).; |
| 776 | c.set_flagscxx . . $ dpp/channel#set_flags(96e87d3ac0704992).(dppcxx . . $ dpp/::c_nsfwcxx . . $ dpp/c_nsfw. | dppcxx . . $ dpp/::c_video_quality_720pcxx . . $ dpp/c_video_quality_720p.); |
| 777 | c.set_typecxx . . $ dpp/channel#set_type(3ebf8b74a0f3745f).(dppcxx . . $ dpp/::CHANNEL_CATEGORYcxx . . $ dpp/CHANNEL_CATEGORY.); |
| 778 | bool before = c.is_categorycxx . . $ dpp/channel#is_category(50ce9a9e25b4a850).() && !c.is_forumcxx . . $ dpp/channel#is_forum(50ce9a9e25b4a850).(); |
| 779 | c.set_typecxx . . $ dpp/channel#set_type(3ebf8b74a0f3745f).(dppcxx . . $ dpp/::CHANNEL_FORUMcxx . . $ dpp/CHANNEL_FORUM.); |
| 780 | bool after = !c.is_categorycxx . . $ dpp/channel#is_category(50ce9a9e25b4a850).() && c.is_forumcxx . . $ dpp/channel#is_forum(50ce9a9e25b4a850).(); |
| 781 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNEL_SET_TYPEcxx . . $ CHANNEL_SET_TYPE., before && after); |
| 782 | |
| 783 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNEL_GET_MENTIONcxx . . $ CHANNEL_GET_MENTION., false); |
| 784 | c.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825411707521728511; |
| 785 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNEL_GET_MENTIONcxx . . $ CHANNEL_GET_MENTION., c.get_mentioncxx . . $ dpp/channel#get_mention(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<#825411707521728511>"); |
| 786 | |
| 787 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNEL_GET_URLcxx . . $ CHANNEL_GET_URL., false); |
| 788 | c.guild_idcxx . . $ dpp/channel#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825407338755653642; |
| 789 | |
| 790 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# c2cxx . . $ dpp/channel#channel(49f6e7a06ebc5aa8).; |
| 791 | c2.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825411707521728511; |
| 792 | |
| 793 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# c3cxx . . $ dpp/channel#channel(49f6e7a06ebc5aa8).; |
| 794 | c3.guild_idcxx . . $ dpp/channel#guild_id. =cxx . . $ dpp/snowflake#`operator=`(877bf232da790af4). 825407338755653642; |
| 795 | |
| 796 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# c4cxx . . $ dpp/channel#channel(49f6e7a06ebc5aa8).; |
| 797 | |
| 798 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNEL_GET_URLcxx . . $ CHANNEL_GET_URL., |
| 799 | c.get_urlcxx . . $ dpp/channel#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_hostcxx . . $ dpp/utility/url_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/channels/825407338755653642/825411707521728511" && |
| 800 | c2.get_urlcxx . . $ dpp/channel#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 801 | c3.get_urlcxx . . $ dpp/channel#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 802 | c4.get_urlcxx . . $ dpp/channel#get_url(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" |
| 803 | ); |
| 804 | } |
| 805 | |
| 806 | { // utility methods |
| 807 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_GUILD_NAVIGATIONcxx . . $ UTILITY_GUILD_NAVIGATION., false); |
| 808 | auto gn1 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::guild_navigationcxx . . $ dpp/utility/guild_navigation(1b8dffe1da1966f2).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::gnt_customizecxx . . $ dpp/utility/gnt_customize.); |
| 809 | auto gn2 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::guild_navigationcxx . . $ dpp/utility/guild_navigation(1b8dffe1da1966f2).(1234cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::gnt_browsecxx . . $ dpp/utility/gnt_browse.); |
| 810 | auto gn3 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::guild_navigationcxx . . $ dpp/utility/guild_navigation(1b8dffe1da1966f2).(12345cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::gnt_guidecxx . . $ dpp/utility/gnt_guide.); |
| 811 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_GUILD_NAVIGATIONcxx . . $ UTILITY_GUILD_NAVIGATION., gn1 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<123:customize>" && gn2 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<1234:browse>" && gn3 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<12345:guide>"); |
| 812 | |
| 813 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_ICONHASHcxx . . $ UTILITY_ICONHASH., false); |
| 814 | auto iconhash1 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::iconhashcxx . . $ dpp/utility/iconhash#("a_5532c6414c70765a28cf9448c117205f"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 815 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_ICONHASHcxx . . $ UTILITY_ICONHASH., iconhash1.firstcxx . . $ dpp/utility/iconhash#first. == 6139187225817019994 && |
| 816 | iconhash1.secondcxx . . $ dpp/utility/iconhash#second. == 2940732121894297695 && |
| 817 | iconhash1.to_stringcxx . . $ dpp/utility/iconhash#to_string(219584694fe2b248).() ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "5532c6414c70765a28cf9448c117205f" |
| 818 | ); |
| 819 | |
| 820 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_MAKE_URL_PARAMETERScxx . . $ UTILITY_MAKE_URL_PARAMETERS., false); |
| 821 | auto url_params1 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::make_url_parameterscxx . . $ dpp/utility/make_url_parameters(1c316434cf4adbf).({cxx . . $ std/map#map(7786ef3e167e36fa). |
| 822 | {"foo", 15}, |
| 823 | {"bar", 7} |
| 824 | }); |
| 825 | auto url_params2 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::make_url_parameterscxx . . $ dpp/utility/make_url_parameters(30daeef213e9e90a).({cxx . . $ std/map#map(7786ef3e167e36fa). |
| 826 | {"foo", "hello"}, |
| 827 | {"bar", "two words"} |
| 828 | }); |
| 829 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_MAKE_URL_PARAMETERScxx . . $ UTILITY_MAKE_URL_PARAMETERS., url_params1 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "?bar=7&foo=15" && url_params2 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "?bar=two%20words&foo=hello"); |
| 830 | |
| 831 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_MARKDOWN_ESCAPEcxx . . $ UTILITY_MARKDOWN_ESCAPE., false); |
| 832 | auto escaped = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::markdown_escapecxx . . $ dpp/utility/markdown_escape(928a7cccc7cc580f).( |
| 833 | "> this is a quote\n"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d). |
| 834 | "**some bold text**"); |
| 835 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_MARKDOWN_ESCAPEcxx . . $ UTILITY_MARKDOWN_ESCAPE., "\\>this is a quote\\n\\*\\*some bold text\\*\\*"); |
| 836 | |
| 837 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_TOKENIZEcxx . . $ UTILITY_TOKENIZE., false); |
| 838 | auto tokens = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::tokenizecxx . . $ dpp/utility/tokenize(736e43a15e727413).("some Whitespace seperated Text to Tokenize"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., " "); |
| 839 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> expected_tokens = {cxx . . $ std/vector#vector(9619226211e5a241)."some", "Whitespace", "seperated", "Text", "to", "Tokenize"}; |
| 840 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_TOKENIZEcxx . . $ UTILITY_TOKENIZE., tokens ==cxx . . $ std/`operator==`(a0a51a13f7e42509). expected_tokens); |
| 841 | |
| 842 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_URL_ENCODEcxx . . $ UTILITY_URL_ENCODE., false); |
| 843 | auto url_encoded = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_encodecxx . . $ dpp/utility/url_encode(fd626fc03107dd24).("S2-^$1Nd+U!g'8+_??o?p-bla bla"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 844 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_URL_ENCODEcxx . . $ UTILITY_URL_ENCODE., url_encoded ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "S2-%5E%241Nd%2BU%21g%278%2B_%3F%3Fo%3Fp-bla%20bla"); |
| 845 | |
| 846 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_SLASHCOMMAND_MENTIONcxx . . $ UTILITY_SLASHCOMMAND_MENTION., false); |
| 847 | auto mention1 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::slashcommand_mentioncxx . . $ dpp/utility/slashcommand_mention(71cb23e7bee6a23b).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., "name"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 848 | auto mention2 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::slashcommand_mentioncxx . . $ dpp/utility/slashcommand_mention(71cb23e7bee6a23b).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., "name"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "sub"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 849 | auto mention3 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::slashcommand_mentioncxx . . $ dpp/utility/slashcommand_mention(cf9a3b59fcad5e20).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., "name"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "group"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "sub"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 850 | bool success = mention1 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "</name:123>" && mention2 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "</name sub:123>" && mention3 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "</name group sub:123>"; |
| 851 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_SLASHCOMMAND_MENTIONcxx . . $ UTILITY_SLASHCOMMAND_MENTION., success); |
| 852 | |
| 853 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_CHANNEL_MENTIONcxx . . $ UTILITY_CHANNEL_MENTION., false); |
| 854 | auto channel_mention = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::channel_mentioncxx . . $ dpp/utility/channel_mention(bebf72dbfefd9cda).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 855 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_CHANNEL_MENTIONcxx . . $ UTILITY_CHANNEL_MENTION., channel_mention ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<#123>"); |
| 856 | |
| 857 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_USER_MENTIONcxx . . $ UTILITY_USER_MENTION., false); |
| 858 | auto user_mention = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::user_mentioncxx . . $ dpp/utility/user_mention(bebf72dbfefd9cda).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 859 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_USER_MENTIONcxx . . $ UTILITY_USER_MENTION., user_mention ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<@123>"); |
| 860 | |
| 861 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_ROLE_MENTIONcxx . . $ UTILITY_ROLE_MENTION., false); |
| 862 | auto role_mention = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::role_mentioncxx . . $ dpp/utility/role_mention(bebf72dbfefd9cda).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 863 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_ROLE_MENTIONcxx . . $ UTILITY_ROLE_MENTION., role_mention ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<@&123>"); |
| 864 | |
| 865 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_EMOJI_MENTIONcxx . . $ UTILITY_EMOJI_MENTION., false); |
| 866 | auto emoji_mention1 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::emoji_mentioncxx . . $ dpp/utility/emoji_mention(5cc1ae9b3529998d).("role1"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., 123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., false); |
| 867 | auto emoji_mention2 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::emoji_mentioncxx . . $ dpp/utility/emoji_mention(5cc1ae9b3529998d).("role2"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., 234cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., true); |
| 868 | auto emoji_mention3 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::emoji_mentioncxx . . $ dpp/utility/emoji_mention(5cc1ae9b3529998d).("white_check_mark"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., false); |
| 869 | auto emoji_mention4 = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::emoji_mentioncxx . . $ dpp/utility/emoji_mention(5cc1ae9b3529998d).("white_check_mark"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., true); |
| 870 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_EMOJI_MENTIONcxx . . $ UTILITY_EMOJI_MENTION., |
| 871 | emoji_mention1 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<:role1:123>" && |
| 872 | emoji_mention2 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "<a:role2:234>" && |
| 873 | emoji_mention3 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). ":white_check_mark:" && |
| 874 | emoji_mention4 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). ":white_check_mark:" |
| 875 | ); |
| 876 | |
| 877 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_USER_URLcxx . . $ UTILITY_USER_URL., false); |
| 878 | auto user_url = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::user_urlcxx . . $ dpp/utility/user_url(bebf72dbfefd9cda).(123cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 879 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_USER_URLcxx . . $ UTILITY_USER_URL., |
| 880 | user_url ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_hostcxx . . $ dpp/utility/url_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/users/123" && |
| 881 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::user_urlcxx . . $ dpp/utility/user_url(bebf72dbfefd9cda).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" |
| 882 | ); |
| 883 | |
| 884 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_MESSAGE_URLcxx . . $ UTILITY_MESSAGE_URL., false); |
| 885 | auto message_url = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 3cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 886 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_MESSAGE_URLcxx . . $ UTILITY_MESSAGE_URL., |
| 887 | message_url ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_hostcxx . . $ dpp/utility/url_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/channels/1/2/3" && |
| 888 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 3cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 889 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 3cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 890 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 891 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 3cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 892 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 893 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 894 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::message_urlcxx . . $ dpp/utility/message_url(a8bfe14d84a91d98).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" |
| 895 | ); |
| 896 | |
| 897 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_CHANNEL_URLcxx . . $ UTILITY_CHANNEL_URL., false); |
| 898 | auto channel_url = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::channel_urlcxx . . $ dpp/utility/channel_url(f90e68d032cd2389).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 899 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_CHANNEL_URLcxx . . $ UTILITY_CHANNEL_URL., |
| 900 | channel_url ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_hostcxx . . $ dpp/utility/url_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/channels/1/2" && |
| 901 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::channel_urlcxx . . $ dpp/utility/channel_url(f90e68d032cd2389).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 902 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::channel_urlcxx . . $ dpp/utility/channel_url(f90e68d032cd2389).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 903 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::channel_urlcxx . . $ dpp/utility/channel_url(f90e68d032cd2389).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" |
| 904 | ); |
| 905 | |
| 906 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_THREAD_URLcxx . . $ UTILITY_THREAD_URL., false); |
| 907 | auto thread_url = dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::thread_urlcxx . . $ dpp/utility/thread_url(f90e68d032cd2389).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 908 | set_testcxx . . $ set_test(c715a584a48bbbaa).(UTILITY_THREAD_URLcxx . . $ UTILITY_THREAD_URL., |
| 909 | thread_url ==cxx . . $ std/`operator==`(5ea818b58063a774). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::url_hostcxx . . $ dpp/utility/url_host. +cxx . . $ std/operator+(40fc1db9226233c6). "/channels/1/2" && |
| 910 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::thread_urlcxx . . $ dpp/utility/thread_url(f90e68d032cd2389).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 911 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::thread_urlcxx . . $ dpp/utility/thread_url(f90e68d032cd2389).(1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" && |
| 912 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::thread_urlcxx . . $ dpp/utility/thread_url(f90e68d032cd2389).(0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "" |
| 913 | ); |
| 914 | } |
| 915 | |
| 916 | #ifndef _WIN32 |
| 917 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMESTRINGTOTIMESTAMPcxx . . $ TIMESTRINGTOTIMESTAMP., false); |
| 918 | jsoncxx . . $ json# tjcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(6d988fd07f070dfc).; |
| 919 | tj[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."t1"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). "2022-01-19T17:18:14.506000+00:00"cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).; |
| 920 | tj[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."t2"] =cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator=`(27bc3588566516b5). "2022-01-19T17:18:14+00:00"cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).; |
| 921 | uint32_tcxx . . $ uint32_t# inTimestamp = 1642612694; |
| 922 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMESTRINGTOTIMESTAMPcxx . . $ TIMESTRINGTOTIMESTAMP., (uint64_tcxx . . $ uint64_t#) dppcxx . . $ dpp/::ts_not_nullcxx . . $ dpp/ts_not_null(f1ee4e6aed88ee78).(&tj, "t1") == inTimestamp && (uint64_tcxx . . $ uint64_t#) dppcxx . . $ dpp/::ts_not_nullcxx . . $ dpp/ts_not_null(f1ee4e6aed88ee78).(&tj, "t2") == inTimestamp); |
| 923 | #else |
| 924 | set_test(TIMESTRINGTOTIMESTAMP, true); |
| 925 | #endif |
| 926 | |
| 927 | { |
| 928 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TScxx . . $ TS., false); |
| 929 | dppcxx . . $ dpp/::managedcxx . . $ dpp/managed# mcxx . . $ dpp/managed#managed(1c8aeb7d200965fe).(189759562910400512cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 930 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TScxx . . $ TS., ((uint64_tcxx . . $ uint64_t#) m.get_creation_timecxx . . $ dpp/managed#get_creation_time(d8440c0a87ad7443).()) == 1465312605); |
| 931 | } |
| 932 | |
| 933 | { |
| 934 | coro_offline_testscxx . . $ coro_offline_tests(49f6e7a06ebc5aa8).(); |
| 935 | } |
| 936 | |
| 937 | stdcxx . . $ std/::promisecxx . . $ std/promise#<void> ready_promisecxx . . $ std/promise#promise(49f6e7a06ebc5aa8).; |
| 938 | stdcxx . . $ std/::future ready_future = ready_promise.get_futurecxx . . $ std/promise#get_future(a3dacade88985352).(); |
| 939 | |
| 940 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::bytecxx . . $ std/byte#> dpp_logo = load_datacxx . . $ load_data(bfcd96bf31b7b509).("DPP-Logo.png"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 941 | |
| 942 | set_testcxx . . $ set_test(c715a584a48bbbaa).(PRESENCEcxx . . $ PRESENCE., false); |
| 943 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CLUSTERcxx . . $ CLUSTER., false); |
| 944 | try { |
| 945 | dppcxx . . $ dpp/::clustercxx . . $ dpp/cluster# botcxx . . $ dpp/cluster#cluster(13cb741d36ace229).(token, dppcxx . . $ dpp/::i_all_intentscxx . . $ dpp/i_all_intents.); |
| 946 | bot.set_websocket_protocolcxx . . $ dpp/cluster#set_websocket_protocol(af3c514d5e977a71).(dppcxx . . $ dpp/::ws_etfcxx . . $ dpp/ws_etf.); |
| 947 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CLUSTERcxx . . $ CLUSTER., true); |
| 948 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CONNECTIONcxx . . $ CONNECTION., false); |
| 949 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILDCREATEcxx . . $ GUILDCREATE., false); |
| 950 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ICONHASHcxx . . $ ICONHASH., false); |
| 951 | |
| 952 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MSGCOLLECTcxx . . $ MSGCOLLECT., false); |
| 953 | if (!offlinecxx . . $ offline.) { |
| 954 | /* Intentional leak: freed on unit test end */ |
| 955 | [[maybe_unused]] |
| 956 | message_collectorcxx . . $ message_collector# *collect_messages = new message_collectorcxx . . $ message_collector#(&bot, 25); |
| 957 | } |
| 958 | |
| 959 | set_testcxx . . $ set_test(c715a584a48bbbaa).(JSON_PARSE_ERRORcxx . . $ JSON_PARSE_ERROR., false); |
| 960 | dppcxx . . $ dpp/::rest_requestcxx . . $ dpp/rest_request(b62de9ddc6875e58).<dppcxx . . $ dpp/::confirmationcxx . . $ dpp/confirmation#>(&bot, "/nonexistent", "address"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::m_getcxx . . $ dpp/m_get., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &e) { |
| 961 | if (e.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).() && e.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().codecxx . . $ dpp/error_info#code. == 404) { |
| 962 | set_testcxx . . $ set_test(c715a584a48bbbaa).(JSON_PARSE_ERRORcxx . . $ JSON_PARSE_ERROR., true); |
| 963 | } else { |
| 964 | set_testcxx . . $ set_test(c715a584a48bbbaa).(JSON_PARSE_ERRORcxx . . $ JSON_PARSE_ERROR., false); |
| 965 | } |
| 966 | }); |
| 967 | |
| 968 | if (!offlinecxx . . $ offline.) { |
| 969 | start_testcxx . . $ start_test(271d3161c6a64dec).(INVALIDUTF8cxx . . $ INVALIDUTF8.); |
| 970 | bot.message_createcxx . . $ dpp/cluster#message_create(1c8df330753bdf1).(dppcxx . . $ dpp/message#message(af8ef704783065ca).::messagecxx . . $ dpp/message#(TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., "ä\xA9ü"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).), [cxx . . $ std/function#function(bdc3712e480e4d04).](const auto &cc) { |
| 971 | set_statuscxx . . $ set_status(69213411294ab03e).(INVALIDUTF8cxx . . $ INVALIDUTF8., ts_successcxx . . $ ts_success.); |
| 972 | }); |
| 973 | } else { |
| 974 | set_statuscxx . . $ set_status(69213411294ab03e).(INVALIDUTF8cxx . . $ INVALIDUTF8., ts_skippedcxx . . $ ts_skipped.); |
| 975 | } |
| 976 | |
| 977 | dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::iconhashcxx . . $ dpp/utility/iconhash# icxx . . $ dpp/utility/iconhash#iconhash(a7e127e7a15e8672).; |
| 978 | stdcxx . . $ std/::stringcxx . . $ std/string# dummyvalcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).("fcffffffffffff55acaaaaaaaaaaaa66"); |
| 979 | i =cxx . . $ dpp/utility/iconhash#`operator=`(99b67a3c0324b6a8). dummyval; |
| 980 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ICONHASHcxx . . $ ICONHASH., (i.to_stringcxx . . $ dpp/utility/iconhash#to_string(219584694fe2b248).() ==cxx . . $ std/`operator==`(5ea818b58063a774). dummyval)); |
| 981 | |
| 982 | /* This ensures we test both protocols, as voice is json and shard is etf */ |
| 983 | bot.set_websocket_protocolcxx . . $ dpp/cluster#set_websocket_protocol(af3c514d5e977a71).(dppcxx . . $ dpp/::ws_etfcxx . . $ dpp/ws_etf.); |
| 984 | |
| 985 | /* This is near impossible to test without a 'clean room' voice channel. |
| 986 | * We attach this event just so that the decoder events are fired while we |
| 987 | * are sending audio later, this way if the audio receive code is plain unstable |
| 988 | * the test suite will crash and fail. |
| 989 | */ |
| 990 | bot.on_voice_receive_combinedcxx . . $ dpp/cluster#on_voice_receive_combined.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&](const auto &event) { |
| 991 | }); |
| 992 | |
| 993 | bot.on_guild_createcxx . . $ dpp/cluster#on_guild_create.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[dpp_logocxx . . $ std/vector#vector(a1201200cf0efa42)., &bot](const dppcxx . . $ dpp/::guild_create_tcxx . . $ dpp/guild_create_t# &event) { |
| 994 | dppcxx . . $ dpp/::guildcxx . . $ dpp/guild# g = event.createdcxx . . $ dpp/guild_create_t#created.; |
| 995 | |
| 996 | if (g.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).) { |
| 997 | start_testcxx . . $ start_test(271d3161c6a64dec).(GUILD_EDITcxx . . $ GUILD_EDIT.); |
| 998 | g.set_iconcxx . . $ dpp/guild#set_icon(742255d4f89fce41).(dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png., dpp_logo.datacxx . . $ std/vector#data(8e614c7de0b1573e).(), static_cast<uint32_tcxx . . $ uint32_t#>(dpp_logo.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).())); |
| 999 | bot.guild_editcxx . . $ dpp/cluster#guild_edit(f5c0c17b9ebf1beb).(g, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &result) { |
| 1000 | if (result.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1001 | set_statuscxx . . $ set_status(69213411294ab03e).(GUILD_EDITcxx . . $ GUILD_EDIT., ts_failedcxx . . $ ts_failed., "guild_edit 1 errored:\n" +cxx . . $ std/operator+(39ed2c165380f78e). result.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable.); |
| 1002 | return; |
| 1003 | } |
| 1004 | dppcxx . . $ dpp/::guildcxx . . $ dpp/guild# g2 = result.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::guildcxx . . $ dpp/guild#>(); |
| 1005 | |
| 1006 | if (g2.get_icon_urlcxx . . $ dpp/guild#get_icon_url(a840917f06f86a96).().emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) { |
| 1007 | set_statuscxx . . $ set_status(69213411294ab03e).(GUILD_EDITcxx . . $ GUILD_EDIT., ts_failedcxx . . $ ts_failed., "icon not set or not retrieved"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 1008 | return; |
| 1009 | } |
| 1010 | g2.remove_iconcxx . . $ dpp/guild#remove_icon(a9d063a2959abc4c).(); |
| 1011 | bot.guild_editcxx . . $ dpp/cluster#guild_edit(f5c0c17b9ebf1beb).(g2, [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &result) { |
| 1012 | if (result.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1013 | set_statuscxx . . $ set_status(69213411294ab03e).(GUILD_EDITcxx . . $ GUILD_EDIT., ts_failedcxx . . $ ts_failed., "guild_edit 2 errored:\n" +cxx . . $ std/operator+(39ed2c165380f78e). result.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable.); |
| 1014 | return; |
| 1015 | } |
| 1016 | const dppcxx . . $ dpp/::guildcxx . . $ dpp/guild# g3 = result.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::guildcxx . . $ dpp/guild#>(); |
| 1017 | if (!g3.get_icon_urlcxx . . $ dpp/guild#get_icon_url(a840917f06f86a96).().emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) { |
| 1018 | set_statuscxx . . $ set_status(69213411294ab03e).(GUILD_EDITcxx . . $ GUILD_EDIT., ts_failedcxx . . $ ts_failed., "icon not removed"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 1019 | return; |
| 1020 | } |
| 1021 | set_statuscxx . . $ set_status(69213411294ab03e).(GUILD_EDITcxx . . $ GUILD_EDIT., ts_successcxx . . $ ts_success.); |
| 1022 | }); |
| 1023 | }); |
| 1024 | } |
| 1025 | }); |
| 1026 | |
| 1027 | bot.on_readycxx . . $ dpp/cluster#on_ready.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&ready_promise, &bot, dpp_logocxx . . $ std/vector#vector(a1201200cf0efa42).](const dppcxx . . $ dpp/::ready_tcxx . . $ dpp/ready_t# &event) { |
| 1028 | |
| 1029 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CONNECTIONcxx . . $ CONNECTION., true); |
| 1030 | ready_promise.set_valuecxx . . $ std/promise#set_value(49f6e7a06ebc5aa8).(); |
| 1031 | |
| 1032 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GETAPPcxx . . $ GETAPP., false); |
| 1033 | bot.current_application_getcxx . . $ dpp/cluster#current_application_get(ca63f3a9a4c18410).([cxx . . $ std/function#function(bdc3712e480e4d04).&bot](const auto& res) { |
| 1034 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GETAPPcxx . . $ GETAPP., !res.is_error() && (stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::applicationcxx . . $ dpp/application#>(res.value)).id == bot.mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.); |
| 1035 | }); |
| 1036 | |
| 1037 | set_testcxx . . $ set_test(c715a584a48bbbaa).(APPCOMMANDcxx . . $ APPCOMMAND., false); |
| 1038 | set_testcxx . . $ set_test(c715a584a48bbbaa).(LOGGERcxx . . $ LOGGER., false); |
| 1039 | bot.logcxx . . $ dpp/cluster#log(7f5f639e8434218f).(dppcxx . . $ dpp/::ll_infocxx . . $ dpp/ll_info., "Test log message"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 1040 | |
| 1041 | bot.guild_command_createcxx . . $ dpp/cluster#guild_command_create(b2ac25535261fc80).(dppcxx . . $ dpp/slashcommand#slashcommand(49f6e7a06ebc5aa8).::slashcommandcxx . . $ dpp/slashcommand#().set_namecxx . . $ dpp/slashcommand#set_name(2400fc375621f539).("testcommand"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).) |
| 1042 | .set_descriptioncxx . . $ dpp/slashcommand#set_description(2400fc375621f539).("Test command for DPP unit test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).) |
| 1043 | .add_optioncxx . . $ dpp/slashcommand#add_option(fb1cd74443f83f3d).(dppcxx . . $ dpp/command_option#command_option(c59bdb698a013f96).::command_optioncxx . . $ dpp/command_option#(dppcxx . . $ dpp/::co_attachmentcxx . . $ dpp/co_attachment., "file"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "a file"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)) |
| 1044 | .set_application_idcxx . . $ dpp/slashcommand#set_application_id(4708295b768c5720).(botcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) |
| 1045 | .add_localizationcxx . . $ dpp/slashcommand#add_localization(877a777a9771127).("fr"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "zut"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "Ou est la salor dans Discord?"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).), |
| 1046 | TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).&](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1047 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1048 | set_testcxx . . $ set_test(c715a584a48bbbaa).(APPCOMMANDcxx . . $ APPCOMMAND., true); |
| 1049 | set_testcxx . . $ set_test(c715a584a48bbbaa).(DELCOMMANDcxx . . $ DELCOMMAND., false); |
| 1050 | dppcxx . . $ dpp/::slashcommandcxx . . $ dpp/slashcommand# s = stdcxx . . $ std/::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::slashcommandcxx . . $ dpp/slashcommand#>(callback.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 1051 | bot.guild_command_deletecxx . . $ dpp/cluster#guild_command_delete(8674faafcd829b3c).(scxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).&](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1052 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1053 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# test_messagecxx . . $ dpp/message#message(af8ef704783065ca).(TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., "test message"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 1054 | |
| 1055 | set_testcxx . . $ set_test(c715a584a48bbbaa).(DELCOMMANDcxx . . $ DELCOMMAND., true); |
| 1056 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGECREATEcxx . . $ MESSAGECREATE., false); |
| 1057 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEEDITcxx . . $ MESSAGEEDIT., false); |
| 1058 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGERECEIVEcxx . . $ MESSAGERECEIVE., false); |
| 1059 | test_message.add_filecxx . . $ dpp/message#add_file(ae7f891108a86875).("no-mime"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., "test"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 1060 | test_message.add_filecxx . . $ dpp/message#add_file(ae7f891108a86875).("test.txt"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., "test"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., "text/plain"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 1061 | test_message.add_filecxx . . $ dpp/message#add_file(ae7f891108a86875).("test.png"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., stdcxx . . $ std/__cxx11/basic_string#basic_string(6f2e210728d16ac0).::stringcxx . . $ std/string#{reinterpret_cast<const char *>(dpp_logo.datacxx . . $ std/vector#data(8e614c7de0b1573e).()), dpp_logo.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()}, "image/png"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 1062 | bot.message_createcxx . . $ dpp/cluster#message_create(1c8df330753bdf1).(test_message, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1063 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1064 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGECREATEcxx . . $ MESSAGECREATE., true); |
| 1065 | set_testcxx . . $ set_test(c715a584a48bbbaa).(REACTcxx . . $ REACT., false); |
| 1066 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m = stdcxx . . $ dpp/message#message(55ae228098ad4d0d).::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::messagecxx . . $ dpp/message#>(callback.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 1067 | set_testcxx . . $ set_test(c715a584a48bbbaa).(REACTEVENTcxx . . $ REACTEVENT., false); |
| 1068 | bot.message_add_reactioncxx . . $ dpp/cluster#message_add_reaction(438a65722d19847f).(mcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., "😄"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1069 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1070 | set_testcxx . . $ set_test(c715a584a48bbbaa).(REACTcxx . . $ REACT., true); |
| 1071 | } else { |
| 1072 | set_testcxx . . $ set_test(c715a584a48bbbaa).(REACTcxx . . $ REACT., false); |
| 1073 | } |
| 1074 | }); |
| 1075 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EDITEVENTcxx . . $ EDITEVENT., false); |
| 1076 | bot.message_editcxx . . $ dpp/cluster#message_edit(1c8df330753bdf1).(dppcxx . . $ dpp/::messagecxx . . $ dpp/message#(m).set_contentcxx . . $ dpp/message#set_content(c72cb981026e5464).("test edit"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).), [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1077 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1078 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEEDITcxx . . $ MESSAGEEDIT., true); |
| 1079 | } |
| 1080 | }); |
| 1081 | } |
| 1082 | }); |
| 1083 | } else { |
| 1084 | set_testcxx . . $ set_test(c715a584a48bbbaa).(DELCOMMANDcxx . . $ DELCOMMAND., false); |
| 1085 | } |
| 1086 | }); |
| 1087 | } |
| 1088 | }); |
| 1089 | }); |
| 1090 | |
| 1091 | bot.on_logcxx . . $ dpp/cluster#on_log.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[](const dppcxx . . $ dpp/::log_tcxx . . $ dpp/log_t# &event) { |
| 1092 | if (event.severitycxx . . $ dpp/log_t#severity. > dppcxx . . $ dpp/::ll_tracecxx . . $ dpp/ll_trace.) { |
| 1093 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockercxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(loglockcxx . . $ loglock.); |
| 1094 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "[" <<cxx . . $ std/basic_ostream#`operator<<`(d90e0e305b0e25c2). stdcxx . . $ std/::fixedcxx . . $ std/fixed(cf36cc481190cd1f). <<cxx . . $ std/`operator<<`(f54f2ca72cfad5a6). stdcxx . . $ std/::setprecisioncxx . . $ std/setprecision(94726062283fda89).(3) <<cxx . . $ std/basic_ostream#`operator<<`(968942d578224538). (dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::time_fcxx . . $ dpp/utility/time_f(31fa7155c10fdd13).() - get_start_timecxx . . $ get_start_time(31fa7155c10fdd13).()) <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "]: "; |
| 1095 | if (event.severitycxx . . $ dpp/log_t#severity. == dppcxx . . $ dpp/::ll_errorcxx . . $ dpp/ll_error.) { |
| 1096 | /* Errors are red */ |
| 1097 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "[\u001b[31m" <<cxx . . $ std/`operator<<`(88df5bef833f7f83). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::loglevelcxx . . $ dpp/utility/loglevel(bd6669da0656db).(event.severitycxx . . $ dpp/log_t#severity.); |
| 1098 | } else { |
| 1099 | /* All other generic logger are cyan */ |
| 1100 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "[\u001b[36m" <<cxx . . $ std/`operator<<`(88df5bef833f7f83). dppcxx . . $ dpp/::utilitycxx . . $ dpp/utility/::loglevelcxx . . $ dpp/utility/loglevel(bd6669da0656db).(event.severitycxx . . $ dpp/log_t#severity.); |
| 1101 | } |
| 1102 | stdcxx . . $ std/::coutcxx . . $ std/cout. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\u001b[0m] " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). event.messagecxx . . $ dpp/log_t#message. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\n"; |
| 1103 | } |
| 1104 | if (event.messagecxx . . $ dpp/log_t#message. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "Test log message") { |
| 1105 | set_testcxx . . $ set_test(c715a584a48bbbaa).(LOGGERcxx . . $ LOGGER., true); |
| 1106 | } |
| 1107 | }); |
| 1108 | |
| 1109 | set_testcxx . . $ set_test(c715a584a48bbbaa).(RUNONCEcxx . . $ RUNONCE., false); |
| 1110 | uint8_tcxx . . $ uint8_t# runs = 0; |
| 1111 | for (int x = 0; x < 10; ++x) { |
| 1112 | if (dppcxx . . $ dpp/::run_oncecxx . . $ dpp/run_once(a52531b27a9fa42b).<struct test_runcxx . . $ main(afcd3168fc1188a4).test_run#>()) { |
| 1113 | runs++; |
| 1114 | } |
| 1115 | } |
| 1116 | set_testcxx . . $ set_test(c715a584a48bbbaa).(RUNONCEcxx . . $ RUNONCE., (runs == 1)); |
| 1117 | |
| 1118 | bot.on_voice_readycxx . . $ dpp/cluster#on_voice_ready.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&testaudio](const dppcxx . . $ dpp/::voice_ready_tcxx . . $ dpp/voice_ready_t# &event) { |
| 1119 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICECONNcxx . . $ VOICECONN., true); |
| 1120 | dppcxx . . $ dpp/::discord_voice_clientcxx . . $ dpp/discord_voice_client# *v = event.voice_clientcxx . . $ dpp/voice_ready_t#voice_client.; |
| 1121 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICESENDcxx . . $ VOICESEND., false); |
| 1122 | if (v && v->is_readycxx . . $ dpp/discord_voice_client#is_ready(c9857a73d68e59ba).()) { |
| 1123 | v->send_audio_rawcxx . . $ dpp/discord_voice_client#send_audio_raw(ccf5db8c4f4f7e6a).((uint16_tcxx . . $ uint16_t# *) testaudio.datacxx . . $ std/vector#data(258ee1c9e0a18a5c).(), testaudio.sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()); |
| 1124 | } else { |
| 1125 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICESENDcxx . . $ VOICESEND., false); |
| 1126 | } |
| 1127 | }); |
| 1128 | |
| 1129 | bot.on_invite_createcxx . . $ dpp/cluster#on_invite_create.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[](const dppcxx . . $ dpp/::invite_create_tcxx . . $ dpp/invite_create_t# &event) { |
| 1130 | auto &inv = event.created_invitecxx . . $ dpp/invite_create_t#created_invite.; |
| 1131 | if (!inv.codecxx . . $ dpp/invite#code..emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && inv.channel_idcxx . . $ dpp/invite#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && inv.guild_idcxx . . $ dpp/invite#guild_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && inv.created_atcxx . . $ dpp/invite#created_at. != 0 && inv.max_usescxx . . $ dpp/invite#max_uses. == 100) { |
| 1132 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_CREATE_EVENTcxx . . $ INVITE_CREATE_EVENT., true); |
| 1133 | } |
| 1134 | }); |
| 1135 | |
| 1136 | bot.on_invite_deletecxx . . $ dpp/cluster#on_invite_delete.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[](const dppcxx . . $ dpp/::invite_delete_tcxx . . $ dpp/invite_delete_t# &event) { |
| 1137 | auto &inv = event.deleted_invitecxx . . $ dpp/invite_delete_t#deleted_invite.; |
| 1138 | if (!inv.codecxx . . $ dpp/invite#code..emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && inv.channel_idcxx . . $ dpp/invite#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && inv.guild_idcxx . . $ dpp/invite#guild_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).) { |
| 1139 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_DELETE_EVENTcxx . . $ INVITE_DELETE_EVENT., true); |
| 1140 | } |
| 1141 | }); |
| 1142 | |
| 1143 | bot.on_voice_buffer_sendcxx . . $ dpp/cluster#on_voice_buffer_send.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[](const dppcxx . . $ dpp/::voice_buffer_send_tcxx . . $ dpp/voice_buffer_send_t# &event) { |
| 1144 | static bool sent_some_data = false; |
| 1145 | |
| 1146 | if (event.buffer_sizecxx . . $ dpp/voice_buffer_send_t#buffer_size. > 0) { |
| 1147 | sent_some_data = true; |
| 1148 | } |
| 1149 | |
| 1150 | if (sent_some_data && event.packets_leftcxx . . $ dpp/voice_buffer_send_t#packets_left. == 0) { |
| 1151 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICESENDcxx . . $ VOICESEND., true); |
| 1152 | } |
| 1153 | }); |
| 1154 | |
| 1155 | bot.on_guild_createcxx . . $ dpp/cluster#on_guild_create.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&bot](const dppcxx . . $ dpp/::guild_create_tcxx . . $ dpp/guild_create_t# &event) { |
| 1156 | if (event.createdcxx . . $ dpp/guild_create_t#created..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).) { |
| 1157 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILDCREATEcxx . . $ GUILDCREATE., true); |
| 1158 | if (event.presencescxx . . $ dpp/guild_create_t#presences..sizecxx . . $ std/unordered_map#size(fe713de6d184c8a).() && event.presencescxx . . $ dpp/guild_create_t#presences..begincxx . . $ std/unordered_map#begin(f3c6e12ee1fe7252).()->cxx . . $ std/__detail/_Node_const_iterator#`operator->`(8e614c7de0b1573e).secondcxx . . $ std/pair#second..user_idcxx . . $ dpp/presence#user_id. > 0) { |
| 1159 | set_testcxx . . $ set_test(c715a584a48bbbaa).(PRESENCEcxx . . $ PRESENCE., true); |
| 1160 | } |
| 1161 | dppcxx . . $ dpp/::guildcxx . . $ dpp/guild# *g = dppcxx . . $ dpp/::find_guildcxx . . $ dpp/find_guild(12282466d18323a1).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).); |
| 1162 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CACHEcxx . . $ CACHE., false); |
| 1163 | if (g) { |
| 1164 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CACHEcxx . . $ CACHE., true); |
| 1165 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICECONNcxx . . $ VOICECONN., false); |
| 1166 | dppcxx . . $ dpp/::discord_clientcxx . . $ dpp/discord_client# *s = bot.get_shardcxx . . $ dpp/cluster#get_shard(ed3cdbf35672c617).(0); |
| 1167 | s->connect_voicecxx . . $ dpp/discord_client#connect_voice(53a6ed65108e7a27).(gcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).->idcxx . . $ dpp/managed#id., TEST_VC_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., false, false); |
| 1168 | } else { |
| 1169 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CACHEcxx . . $ CACHE., false); |
| 1170 | } |
| 1171 | } |
| 1172 | }); |
| 1173 | |
| 1174 | // this helper class contains logic for the message tests, deletes the message when all tests are done |
| 1175 | class message_test_helpercxx . . $ main(afcd3168fc1188a4).message_test_helper# { |
| 1176 | private: |
| 1177 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# mutexcxx . . $ main(afcd3168fc1188a4).message_test_helper#mutex.; |
| 1178 | bool pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#pin_tested.; |
| 1179 | bool thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_tested.; |
| 1180 | stdcxx . . $ std/::arraycxx . . $ std/array#<bool, 3> files_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_tested.; |
| 1181 | stdcxx . . $ std/::arraycxx . . $ std/array#<bool, 3> files_successcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_success.; |
| 1182 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# channel_idcxx . . $ main(afcd3168fc1188a4).message_test_helper#channel_id.; |
| 1183 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# message_idcxx . . $ main(afcd3168fc1188a4).message_test_helper#message_id.; |
| 1184 | dppcxx . . $ dpp/::clustercxx . . $ dpp/cluster# &botcxx . . $ main(afcd3168fc1188a4).message_test_helper#bot.; |
| 1185 | |
| 1186 | void delete_message_if_donecxx . . $ main(afcd3168fc1188a4).message_test_helper#delete_message_if_done(49f6e7a06ebc5aa8).() { |
| 1187 | if (files_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_tested. ==cxx . . $ std/`operator==`(a474572a1f22b964). stdcxx . . $ std/::array{true, true, true} && pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#pin_tested. && thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_tested.) { |
| 1188 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEDELETEcxx . . $ MESSAGEDELETE., false); |
| 1189 | botcxx . . $ main(afcd3168fc1188a4).message_test_helper#bot..message_deletecxx . . $ dpp/cluster#message_delete(8674faafcd829b3c).(message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., channel_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1190 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEDELETEcxx . . $ MESSAGEDELETE., !callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()); |
| 1191 | }); |
| 1192 | } |
| 1193 | } |
| 1194 | |
| 1195 | void set_pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_pin_tested(49f6e7a06ebc5aa8).() { |
| 1196 | if (pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#pin_tested.) { |
| 1197 | return; |
| 1198 | } |
| 1199 | pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#pin_tested. = true; |
| 1200 | delete_message_if_donecxx . . $ main(afcd3168fc1188a4).message_test_helper#delete_message_if_done(49f6e7a06ebc5aa8).(); |
| 1201 | } |
| 1202 | |
| 1203 | void set_thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_thread_tested(49f6e7a06ebc5aa8).() { |
| 1204 | if (thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_tested.) { |
| 1205 | return; |
| 1206 | } |
| 1207 | thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_tested. = true; |
| 1208 | delete_message_if_donecxx . . $ main(afcd3168fc1188a4).message_test_helper#delete_message_if_done(49f6e7a06ebc5aa8).(); |
| 1209 | } |
| 1210 | |
| 1211 | void set_file_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_file_tested(2c44cd906ae4e829).(size_t index) { |
| 1212 | if (files_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_tested.[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).index]) { |
| 1213 | return; |
| 1214 | } |
| 1215 | files_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_tested.[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).index] = true; |
| 1216 | if (files_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_tested. ==cxx . . $ std/`operator==`(a474572a1f22b964). stdcxx . . $ std/::array{true, true, true}) { |
| 1217 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEFILEcxx . . $ MESSAGEFILE., files_successcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_success. ==cxx . . $ std/`operator==`(a474572a1f22b964). stdcxx . . $ std/::array{true, true, true}); |
| 1218 | } |
| 1219 | delete_message_if_donecxx . . $ main(afcd3168fc1188a4).message_test_helper#delete_message_if_done(49f6e7a06ebc5aa8).(); |
| 1220 | } |
| 1221 | |
| 1222 | void test_threadscxx . . $ main(afcd3168fc1188a4).message_test_helper#test_threads(55ae228098ad4d0d).(const dppcxx . . $ dpp/::messagecxx . . $ dpp/message# &message) { |
| 1223 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_CREATE_MESSAGEcxx . . $ THREAD_CREATE_MESSAGE., false); |
| 1224 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_DELETEcxx . . $ THREAD_DELETE., false); |
| 1225 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_DELETE_EVENTcxx . . $ THREAD_DELETE_EVENT., false); |
| 1226 | botcxx . . $ main(afcd3168fc1188a4).message_test_helper#bot..thread_create_with_messagecxx . . $ dpp/cluster#thread_create_with_message(d9b43086eaded6bf).("test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., messagecxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..channel_idcxx . . $ dpp/message#channel_id., messagecxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., 60, 60, [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1227 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(mutexcxx . . $ main(afcd3168fc1188a4).message_test_helper#mutex.); |
| 1228 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1229 | set_thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_thread_tested(49f6e7a06ebc5aa8).(); |
| 1230 | } else { |
| 1231 | auto thread = callback.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::threadcxx . . $ dpp/thread#>(); |
| 1232 | thread_idcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). thread.idcxx . . $ dpp/managed#id.; |
| 1233 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_CREATE_MESSAGEcxx . . $ THREAD_CREATE_MESSAGE., true); |
| 1234 | botcxx . . $ main(afcd3168fc1188a4).message_test_helper#bot..channel_deletecxx . . $ dpp/cluster#channel_delete(f0cdb3822bb61a0b).(threadcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1235 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_DELETEcxx . . $ THREAD_DELETE., !callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()); |
| 1236 | set_thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_thread_tested(49f6e7a06ebc5aa8).(); |
| 1237 | }); |
| 1238 | } |
| 1239 | }); |
| 1240 | } |
| 1241 | |
| 1242 | void test_filescxx . . $ main(afcd3168fc1188a4).message_test_helper#test_files(55ae228098ad4d0d).(const dppcxx . . $ dpp/::messagecxx . . $ dpp/message# &message) { |
| 1243 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEFILEcxx . . $ MESSAGEFILE., false); |
| 1244 | if (message.attachmentscxx . . $ dpp/message#attachments..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() == 3) { |
| 1245 | static constexpr auto check_mimetype = [](const auto &headers, stdcxx . . $ std/::stringcxx . . $ std/string# mimetype) { |
| 1246 | if (auto it = headers.find("content-type"); it != headers.end()) { |
| 1247 | // check that the mime type starts with what we gave : for example discord will change "text/plain" to "text/plain; charset=UTF-8" |
| 1248 | return it->second.size() >= mimetype.sizecxx . . $ std/__cxx11/basic_string#size(7e80fff40d76986b).() && stdcxx . . $ std/::equalcxx . . $ std/equal(f82cc6ce9cd000ea).(it->second.begin(), it->second.begin() + mimetype.sizecxx . . $ std/__cxx11/basic_string#size(7e80fff40d76986b).(), mimetype.begincxx . . $ std/__cxx11/basic_string#begin(fd29ebd65481b919).()); |
| 1249 | } else { |
| 1250 | return false; |
| 1251 | } |
| 1252 | }; |
| 1253 | message.attachmentscxx . . $ dpp/message#attachments.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).0].downloadcxx . . $ dpp/attachment#download(9fe5db44b5cf22f4).([cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::http_request_completion_tcxx . . $ dpp/http_request_completion_t# &callback) { |
| 1254 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(mutexcxx . . $ main(afcd3168fc1188a4).message_test_helper#mutex.); |
| 1255 | if (callback.statuscxx . . $ dpp/http_request_completion_t#status. == 200 && callback.bodycxx . . $ dpp/http_request_completion_t#body. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test") { |
| 1256 | files_successcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_success.[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).0] = true; |
| 1257 | } |
| 1258 | set_file_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_file_tested(2c44cd906ae4e829).(0); |
| 1259 | }); |
| 1260 | message.attachmentscxx . . $ dpp/message#attachments.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).1].downloadcxx . . $ dpp/attachment#download(9fe5db44b5cf22f4).([cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::http_request_completion_tcxx . . $ dpp/http_request_completion_t# &callback) { |
| 1261 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(mutexcxx . . $ main(afcd3168fc1188a4).message_test_helper#mutex.); |
| 1262 | if (callback.statuscxx . . $ dpp/http_request_completion_t#status. == 200 && check_mimetype(cxx . . $ main(afcd3168fc1188a4).message_test_helper#test_files(55ae228098ad4d0d).$anonymous_type_2#`operator()`(1ad8ca97f80e10fb).callback.headerscxx . . $ dpp/http_request_completion_t#headers., "text/plain"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).) && callback.bodycxx . . $ dpp/http_request_completion_t#body. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test") { |
| 1263 | files_successcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_success.[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).1] = true; |
| 1264 | } |
| 1265 | set_file_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_file_tested(2c44cd906ae4e829).(1); |
| 1266 | }); |
| 1267 | message.attachmentscxx . . $ dpp/message#attachments.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).2].downloadcxx . . $ dpp/attachment#download(9fe5db44b5cf22f4).([cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::http_request_completion_tcxx . . $ dpp/http_request_completion_t# &callback) { |
| 1268 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(mutexcxx . . $ main(afcd3168fc1188a4).message_test_helper#mutex.); |
| 1269 | // do not check the contents here because discord can change compression |
| 1270 | if (callback.statuscxx . . $ dpp/http_request_completion_t#status. == 200 && check_mimetype(cxx . . $ main(afcd3168fc1188a4).message_test_helper#test_files(55ae228098ad4d0d).$anonymous_type_2#`operator()`(1ad8ca97f80e10fb).callback.headerscxx . . $ dpp/http_request_completion_t#headers., "image/png"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).)) { |
| 1271 | files_successcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_success.[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).2] = true; |
| 1272 | } |
| 1273 | set_file_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_file_tested(2c44cd906ae4e829).(2); |
| 1274 | }); |
| 1275 | } else { |
| 1276 | set_file_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_file_tested(2c44cd906ae4e829).(0); |
| 1277 | set_file_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_file_tested(2c44cd906ae4e829).(1); |
| 1278 | set_file_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_file_tested(2c44cd906ae4e829).(2); |
| 1279 | } |
| 1280 | } |
| 1281 | |
| 1282 | void test_pincxx . . $ main(afcd3168fc1188a4).message_test_helper#test_pin(49f6e7a06ebc5aa8).() { |
| 1283 | if (!extendedcxx . . $ extended.) { |
| 1284 | set_pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_pin_tested(49f6e7a06ebc5aa8).(); |
| 1285 | return; |
| 1286 | } |
| 1287 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEPINcxx . . $ MESSAGEPIN., false); |
| 1288 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEUNPINcxx . . $ MESSAGEUNPIN., false); |
| 1289 | botcxx . . $ main(afcd3168fc1188a4).message_test_helper#bot..message_pincxx . . $ dpp/cluster#message_pin(8674faafcd829b3c).(channel_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1290 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(mutexcxx . . $ main(afcd3168fc1188a4).message_test_helper#mutex.); |
| 1291 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1292 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEPINcxx . . $ MESSAGEPIN., true); |
| 1293 | botcxx . . $ main(afcd3168fc1188a4).message_test_helper#bot..message_unpincxx . . $ dpp/cluster#message_unpin(8674faafcd829b3c).(TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1294 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(mutexcxx . . $ main(afcd3168fc1188a4).message_test_helper#mutex.); |
| 1295 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1296 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGEUNPINcxx . . $ MESSAGEUNPIN., true); |
| 1297 | } |
| 1298 | set_pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_pin_tested(49f6e7a06ebc5aa8).(); |
| 1299 | }); |
| 1300 | } else { |
| 1301 | set_pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#set_pin_tested(49f6e7a06ebc5aa8).(); |
| 1302 | } |
| 1303 | }); |
| 1304 | } |
| 1305 | |
| 1306 | public: |
| 1307 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# thread_idcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_id.; |
| 1308 | |
| 1309 | message_test_helpercxx . . $ main(afcd3168fc1188a4).message_test_helper#message_test_helper(16f96d49d4c16847).(dppcxx . . $ dpp/::clustercxx . . $ dpp/cluster# &_bot) : botcxx . . $ main(afcd3168fc1188a4).message_test_helper#bot.(_bot) { |
| 1310 | } |
| 1311 | |
| 1312 | void runcxx . . $ main(afcd3168fc1188a4).message_test_helper#run(55ae228098ad4d0d).(const dppcxx . . $ dpp/::messagecxx . . $ dpp/message# &message) { |
| 1313 | pin_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#pin_tested. = false; |
| 1314 | thread_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_tested. = false; |
| 1315 | files_testedcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_tested. =cxx . . $ std/array#`operator=`(460bbbe5d129ca37). {false, false, false}; |
| 1316 | files_successcxx . . $ main(afcd3168fc1188a4).message_test_helper#files_success. =cxx . . $ std/array#`operator=`(460bbbe5d129ca37). {false, false, false}; |
| 1317 | channel_idcxx . . $ main(afcd3168fc1188a4).message_test_helper#channel_id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). message.channel_idcxx . . $ dpp/message#channel_id.; |
| 1318 | message_idcxx . . $ main(afcd3168fc1188a4).message_test_helper#message_id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). message.idcxx . . $ dpp/managed#id.; |
| 1319 | test_pincxx . . $ main(afcd3168fc1188a4).message_test_helper#test_pin(49f6e7a06ebc5aa8).(); |
| 1320 | test_filescxx . . $ main(afcd3168fc1188a4).message_test_helper#test_files(55ae228098ad4d0d).(message); |
| 1321 | test_threadscxx . . $ main(afcd3168fc1188a4).message_test_helper#test_threads(55ae228098ad4d0d).(message); |
| 1322 | } |
| 1323 | }; |
| 1324 | |
| 1325 | message_test_helpercxx . . $ main(afcd3168fc1188a4).message_test_helper# message_helpercxx . . $ main(afcd3168fc1188a4).message_test_helper#message_test_helper(16f96d49d4c16847).(bot); |
| 1326 | |
| 1327 | class thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper# { |
| 1328 | public: |
| 1329 | enum event_flagcxx . . $ main(afcd3168fc1188a4).thread_test_helper#event_flag# { |
| 1330 | MESSAGE_CREATEcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_CREATE. = 1 << 0, |
| 1331 | MESSAGE_EDITcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_EDIT. = 1 << 1, |
| 1332 | MESSAGE_REACTcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_REACT. = 1 << 2, |
| 1333 | MESSAGE_REMOVE_REACTcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_REMOVE_REACT. = 1 << 3, |
| 1334 | MESSAGE_DELETEcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_DELETE. = 1 << 4, |
| 1335 | EVENT_ENDcxx . . $ main(afcd3168fc1188a4).thread_test_helper#EVENT_END. = 1 << 5 |
| 1336 | }; |
| 1337 | private: |
| 1338 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.; |
| 1339 | dppcxx . . $ dpp/::clustercxx . . $ dpp/cluster# &botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot.; |
| 1340 | bool edit_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#edit_tested. = false; |
| 1341 | bool members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#members_tested. = false; |
| 1342 | bool messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#messages_tested. = false; |
| 1343 | bool events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested. = false; |
| 1344 | bool get_active_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#get_active_tested. = false; |
| 1345 | uint32_tcxx . . $ uint32_t# events_tested_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested_mask. = 0; |
| 1346 | uint32_tcxx . . $ uint32_t# events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask. = 0; |
| 1347 | |
| 1348 | void delete_if_donecxx . . $ main(afcd3168fc1188a4).thread_test_helper#delete_if_done(49f6e7a06ebc5aa8).() { |
| 1349 | if (edit_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#edit_tested. && members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#members_tested. && messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#messages_tested. && events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested. && get_active_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#get_active_tested.) { |
| 1350 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..channel_deletecxx . . $ dpp/cluster#channel_delete(f0cdb3822bb61a0b).(thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).); |
| 1351 | } |
| 1352 | } |
| 1353 | |
| 1354 | void set_events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_events_tested(49f6e7a06ebc5aa8).() { |
| 1355 | if (events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested.) { |
| 1356 | return; |
| 1357 | } |
| 1358 | events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested. = true; |
| 1359 | delete_if_donecxx . . $ main(afcd3168fc1188a4).thread_test_helper#delete_if_done(49f6e7a06ebc5aa8).(); |
| 1360 | } |
| 1361 | |
| 1362 | void set_edit_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_edit_tested(49f6e7a06ebc5aa8).() { |
| 1363 | if (edit_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#edit_tested.) { |
| 1364 | return; |
| 1365 | } |
| 1366 | edit_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#edit_tested. = true; |
| 1367 | delete_if_donecxx . . $ main(afcd3168fc1188a4).thread_test_helper#delete_if_done(49f6e7a06ebc5aa8).(); |
| 1368 | } |
| 1369 | |
| 1370 | void set_members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_members_tested(49f6e7a06ebc5aa8).() { |
| 1371 | if (members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#members_tested.) { |
| 1372 | return; |
| 1373 | } |
| 1374 | members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#members_tested. = true; |
| 1375 | delete_if_donecxx . . $ main(afcd3168fc1188a4).thread_test_helper#delete_if_done(49f6e7a06ebc5aa8).(); |
| 1376 | } |
| 1377 | |
| 1378 | void set_get_active_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_get_active_tested(49f6e7a06ebc5aa8).() { |
| 1379 | if (get_active_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#get_active_tested.) { |
| 1380 | return; |
| 1381 | } |
| 1382 | get_active_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#get_active_tested. = true; |
| 1383 | delete_if_donecxx . . $ main(afcd3168fc1188a4).thread_test_helper#delete_if_done(49f6e7a06ebc5aa8).(); |
| 1384 | } |
| 1385 | |
| 1386 | void set_messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_messages_tested(49f6e7a06ebc5aa8).() { |
| 1387 | if (messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#messages_tested.) { |
| 1388 | return; |
| 1389 | } |
| 1390 | messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#messages_tested. = true; |
| 1391 | delete_if_donecxx . . $ main(afcd3168fc1188a4).thread_test_helper#delete_if_done(49f6e7a06ebc5aa8).(); |
| 1392 | } |
| 1393 | |
| 1394 | void set_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_event_tested(f1b1972d76c0f663).(event_flagcxx . . $ main(afcd3168fc1188a4).thread_test_helper#event_flag# flag) { |
| 1395 | if (events_tested_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested_mask. & flag) { |
| 1396 | return; |
| 1397 | } |
| 1398 | events_tested_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested_mask. |= flag; |
| 1399 | for (uint32_tcxx . . $ uint32_t# i = 1; i < EVENT_ENDcxx . . $ main(afcd3168fc1188a4).thread_test_helper#EVENT_END.; i <<= 1) { |
| 1400 | if ((events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask. & i) && (events_tested_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested_mask. & i) != i) { |
| 1401 | return; |
| 1402 | } |
| 1403 | } |
| 1404 | set_events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_events_tested(49f6e7a06ebc5aa8).(); |
| 1405 | } |
| 1406 | |
| 1407 | void events_abortcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_abort(49f6e7a06ebc5aa8).() { |
| 1408 | events_tested_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested_mask. |= ~events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask.; |
| 1409 | for (uint32_tcxx . . $ uint32_t# i = 1; i < EVENT_ENDcxx . . $ main(afcd3168fc1188a4).thread_test_helper#EVENT_END.; i <<= 1) { |
| 1410 | if ((events_tested_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_tested_mask. & i) != i) { |
| 1411 | return; |
| 1412 | } |
| 1413 | } |
| 1414 | set_events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_events_tested(49f6e7a06ebc5aa8).(); |
| 1415 | } |
| 1416 | |
| 1417 | public: |
| 1418 | /** |
| 1419 | * @Brief wrapper for set_event_tested, locking the mutex. Meant to be used from outside the class |
| 1420 | */ |
| 1421 | void notify_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#notify_event_tested(f1b1972d76c0f663).(event_flagcxx . . $ main(afcd3168fc1188a4).thread_test_helper#event_flag# flag) { |
| 1422 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1423 | |
| 1424 | set_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_event_tested(f1b1972d76c0f663).(flag); |
| 1425 | } |
| 1426 | |
| 1427 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id.; |
| 1428 | |
| 1429 | void test_editcxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_edit(d30fd0feef9367ab).(const dppcxx . . $ dpp/::threadcxx . . $ dpp/thread# &thread) { |
| 1430 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1431 | |
| 1432 | if (!edit_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#edit_tested.) { |
| 1433 | dppcxx . . $ dpp/::threadcxx . . $ dpp/thread# edit = thread; |
| 1434 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_EDITcxx . . $ THREAD_EDIT., false); |
| 1435 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_UPDATE_EVENTcxx . . $ THREAD_UPDATE_EVENT., false); |
| 1436 | edit.namecxx . . $ dpp/channel#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "edited"; |
| 1437 | edit.metadatacxx . . $ dpp/thread#metadata..lockedcxx . . $ dpp/thread_metadata#locked. = true; |
| 1438 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..thread_editcxx . . $ dpp/cluster#thread_edit(5878a5e1f294b75b).(edit, [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1439 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.); |
| 1440 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1441 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_EDITcxx . . $ THREAD_EDIT., true); |
| 1442 | } |
| 1443 | set_edit_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_edit_tested(49f6e7a06ebc5aa8).(); |
| 1444 | }); |
| 1445 | } |
| 1446 | } |
| 1447 | |
| 1448 | void test_get_activecxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_get_active(d30fd0feef9367ab).(const dppcxx . . $ dpp/::threadcxx . . $ dpp/thread# &thread) { |
| 1449 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1450 | |
| 1451 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_GET_ACTIVEcxx . . $ THREAD_GET_ACTIVE., false); |
| 1452 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..threads_get_activecxx . . $ dpp/cluster#threads_get_active(f0cdb3822bb61a0b).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1453 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1454 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1455 | const auto &threads = callback.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::active_threadscxx . . $ dpp/active_threads#>(); |
| 1456 | if (auto thread_it = threads.findcxx . . $ std/map#find(7b3585bb5da8f7d).(thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id.); thread_it != threads.endcxx . . $ std/map#end(b953fec338ad1a3b).()) { |
| 1457 | const auto &thread = thread_it->cxx . . $ std/_Rb_tree_const_iterator#`operator->`(8e614c7de0b1573e).secondcxx . . $ std/pair#second..active_threadcxx . . $ dpp/active_thread_info#active_thread.; |
| 1458 | const auto &member = thread_it->cxx . . $ std/_Rb_tree_const_iterator#`operator->`(8e614c7de0b1573e).secondcxx . . $ std/pair#second..bot_membercxx . . $ dpp/active_thread_info#bot_member.; |
| 1459 | if (thread.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && member.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && member->cxx . . $ std/optional#`operator->`(8e614c7de0b1573e).user_idcxx . . $ dpp/thread_member#user_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). botcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) { |
| 1460 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_GET_ACTIVEcxx . . $ THREAD_GET_ACTIVE., true); |
| 1461 | } |
| 1462 | } |
| 1463 | } |
| 1464 | set_get_active_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_get_active_tested(49f6e7a06ebc5aa8).(); |
| 1465 | }); |
| 1466 | } |
| 1467 | |
| 1468 | void test_memberscxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_members(d30fd0feef9367ab).(const dppcxx . . $ dpp/::threadcxx . . $ dpp/thread# &thread) { |
| 1469 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1470 | |
| 1471 | if (!members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#members_tested.) { |
| 1472 | if (!extendedcxx . . $ extended.) { |
| 1473 | set_members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_members_tested(49f6e7a06ebc5aa8).(); |
| 1474 | return; |
| 1475 | } |
| 1476 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBER_ADDcxx . . $ THREAD_MEMBER_ADD., false); |
| 1477 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBER_GETcxx . . $ THREAD_MEMBER_GET., false); |
| 1478 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBERS_GETcxx . . $ THREAD_MEMBERS_GET., false); |
| 1479 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBER_REMOVEcxx . . $ THREAD_MEMBER_REMOVE., false); |
| 1480 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBERS_ADD_EVENTcxx . . $ THREAD_MEMBERS_ADD_EVENT., false); |
| 1481 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBERS_REMOVE_EVENTcxx . . $ THREAD_MEMBERS_REMOVE_EVENT., false); |
| 1482 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..thread_member_addcxx . . $ dpp/cluster#thread_member_add(8674faafcd829b3c).(thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1483 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1484 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1485 | set_members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_members_tested(49f6e7a06ebc5aa8).(); |
| 1486 | return; |
| 1487 | } |
| 1488 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBER_ADDcxx . . $ THREAD_MEMBER_ADD., true); |
| 1489 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..thread_member_getcxx . . $ dpp/cluster#thread_member_get(8674faafcd829b3c).(thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1490 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1491 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1492 | set_members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_members_tested(49f6e7a06ebc5aa8).(); |
| 1493 | return; |
| 1494 | } |
| 1495 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBER_GETcxx . . $ THREAD_MEMBER_GET., true); |
| 1496 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..thread_members_getcxx . . $ dpp/cluster#thread_members_get(f0cdb3822bb61a0b).(thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1497 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1498 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1499 | set_members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_members_tested(49f6e7a06ebc5aa8).(); |
| 1500 | return; |
| 1501 | } |
| 1502 | const auto &members = callback.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::thread_member_mapcxx . . $ dpp/thread_member_map#>(); |
| 1503 | if (members.findcxx . . $ std/unordered_map#find(f39fe4bedfa7a693).(TEST_USER_IDcxx . . $ TEST_USER_ID.) ==cxx . . $ std/__detail/`operator==`(7b3545303588e7ff). members.endcxx . . $ std/unordered_map#end(f3c6e12ee1fe7252).() || members.findcxx . . $ std/unordered_map#find(f39fe4bedfa7a693).(botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) ==cxx . . $ std/__detail/`operator==`(7b3545303588e7ff). members.endcxx . . $ std/unordered_map#end(f3c6e12ee1fe7252).()) { |
| 1504 | set_members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_members_tested(49f6e7a06ebc5aa8).(); |
| 1505 | return; |
| 1506 | } |
| 1507 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBERS_GETcxx . . $ THREAD_MEMBERS_GET., true); |
| 1508 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..thread_member_removecxx . . $ dpp/cluster#thread_member_remove(8674faafcd829b3c).(thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1509 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1510 | if (!callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1511 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBER_REMOVEcxx . . $ THREAD_MEMBER_REMOVE., true); |
| 1512 | } |
| 1513 | set_members_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_members_tested(49f6e7a06ebc5aa8).(); |
| 1514 | }); |
| 1515 | }); |
| 1516 | }); |
| 1517 | }); |
| 1518 | } |
| 1519 | } |
| 1520 | |
| 1521 | void test_messagescxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_messages(d30fd0feef9367ab).(const dppcxx . . $ dpp/::threadcxx . . $ dpp/thread# &thread) { |
| 1522 | if (!extendedcxx . . $ extended.) { |
| 1523 | set_messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_messages_tested(49f6e7a06ebc5aa8).(); |
| 1524 | set_events_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_events_tested(49f6e7a06ebc5aa8).(); |
| 1525 | return; |
| 1526 | } |
| 1527 | |
| 1528 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1529 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGEcxx . . $ THREAD_MESSAGE., false); |
| 1530 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_CREATE_EVENTcxx . . $ THREAD_MESSAGE_CREATE_EVENT., false); |
| 1531 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_EDIT_EVENTcxx . . $ THREAD_MESSAGE_EDIT_EVENT., false); |
| 1532 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_REACT_ADD_EVENTcxx . . $ THREAD_MESSAGE_REACT_ADD_EVENT., false); |
| 1533 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_REACT_REMOVE_EVENTcxx . . $ THREAD_MESSAGE_REACT_REMOVE_EVENT., false); |
| 1534 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_DELETE_EVENTcxx . . $ THREAD_MESSAGE_DELETE_EVENT., false); |
| 1535 | events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask. |= MESSAGE_CREATEcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_CREATE.; |
| 1536 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..message_createcxx . . $ dpp/cluster#message_create(1c8df330753bdf1).(dppcxx . . $ dpp/message#message(fbcd06f54f544a76).::messagecxx . . $ dpp/message#{"hello thread"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).}.set_channel_idcxx . . $ dpp/message#set_channel_id(5838913a8bdb38e4).(threadcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id.), [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1537 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1538 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1539 | events_abortcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_abort(49f6e7a06ebc5aa8).(); |
| 1540 | set_messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_messages_tested(49f6e7a06ebc5aa8).(); |
| 1541 | return; |
| 1542 | } |
| 1543 | auto m = callback.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::messagecxx . . $ dpp/message#>(); |
| 1544 | m.contentcxx . . $ dpp/message#content. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "hello thread?"; |
| 1545 | events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask. |= MESSAGE_EDITcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_EDIT.; |
| 1546 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..message_editcxx . . $ dpp/cluster#message_edit(1c8df330753bdf1).(m, [cxx . . $ std/function#function(bdc3712e480e4d04).this, message_id = mcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id.](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1547 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1548 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1549 | events_abortcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_abort(49f6e7a06ebc5aa8).(); |
| 1550 | set_messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_messages_tested(49f6e7a06ebc5aa8).(); |
| 1551 | return; |
| 1552 | } |
| 1553 | events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask. |= MESSAGE_REACTcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_REACT.; |
| 1554 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..message_add_reactioncxx . . $ dpp/cluster#message_add_reaction(438a65722d19847f).(message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., dppcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::unicode_emojicxx . . $ dpp/unicode_emoji/::threadcxx . . $ dpp/unicode_emoji/thread., [cxx . . $ std/function#function(bdc3712e480e4d04).this, message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1555 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1556 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1557 | events_abortcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_abort(49f6e7a06ebc5aa8).(); |
| 1558 | set_messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_messages_tested(49f6e7a06ebc5aa8).(); |
| 1559 | return; |
| 1560 | } |
| 1561 | events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask. |= MESSAGE_REMOVE_REACTcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_REMOVE_REACT.; |
| 1562 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..message_delete_reactioncxx . . $ dpp/cluster#message_delete_reaction(de900c19faeaa67c).(message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., botcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id., dppcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).::unicode_emojicxx . . $ dpp/unicode_emoji/::threadcxx . . $ dpp/unicode_emoji/thread., [cxx . . $ std/function#function(bdc3712e480e4d04).this, message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1563 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1564 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1565 | events_abortcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_abort(49f6e7a06ebc5aa8).(); |
| 1566 | set_messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_messages_tested(49f6e7a06ebc5aa8).(); |
| 1567 | return; |
| 1568 | } |
| 1569 | events_to_test_maskcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_to_test_mask. |= MESSAGE_DELETEcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_DELETE.; |
| 1570 | botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot..message_deletecxx . . $ dpp/cluster#message_delete(8674faafcd829b3c).(message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., thread_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).this](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &callback) { |
| 1571 | stdcxx . . $ std/::lock_guard lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).{mutexcxx . . $ main(afcd3168fc1188a4).thread_test_helper#mutex.}; |
| 1572 | set_messages_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#set_messages_tested(49f6e7a06ebc5aa8).(); |
| 1573 | if (callback.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1574 | events_abortcxx . . $ main(afcd3168fc1188a4).thread_test_helper#events_abort(49f6e7a06ebc5aa8).(); |
| 1575 | return; |
| 1576 | } |
| 1577 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGEcxx . . $ THREAD_MESSAGE., true); |
| 1578 | }); |
| 1579 | }); |
| 1580 | }); |
| 1581 | }); |
| 1582 | }); |
| 1583 | } |
| 1584 | |
| 1585 | void runcxx . . $ main(afcd3168fc1188a4).thread_test_helper#run(d30fd0feef9367ab).(const dppcxx . . $ dpp/::threadcxx . . $ dpp/thread# &thread) { |
| 1586 | thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). thread.idcxx . . $ dpp/managed#id.; |
| 1587 | test_get_activecxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_get_active(d30fd0feef9367ab).(thread); |
| 1588 | test_editcxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_edit(d30fd0feef9367ab).(thread); |
| 1589 | test_memberscxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_members(d30fd0feef9367ab).(thread); |
| 1590 | test_messagescxx . . $ main(afcd3168fc1188a4).thread_test_helper#test_messages(d30fd0feef9367ab).(thread); |
| 1591 | } |
| 1592 | |
| 1593 | thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_test_helper(16f96d49d4c16847).(dppcxx . . $ dpp/::clustercxx . . $ dpp/cluster# &bot_) : botcxx . . $ main(afcd3168fc1188a4).thread_test_helper#bot.{bot_} { |
| 1594 | } |
| 1595 | }; |
| 1596 | |
| 1597 | thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper# thread_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_test_helper(16f96d49d4c16847).(bot); |
| 1598 | |
| 1599 | bot.on_thread_createcxx . . $ dpp/cluster#on_thread_create.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&thread_helper](const dppcxx . . $ dpp/::thread_create_tcxx . . $ dpp/thread_create_t# &event) { |
| 1600 | if (event.createdcxx . . $ dpp/thread_create_t#created..namecxx . . $ dpp/channel#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "thread test") { |
| 1601 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_CREATE_EVENTcxx . . $ THREAD_CREATE_EVENT., true); |
| 1602 | thread_helper.runcxx . . $ main(afcd3168fc1188a4).thread_test_helper#run(d30fd0feef9367ab).(event.createdcxx . . $ dpp/thread_create_t#created.); |
| 1603 | } |
| 1604 | }); |
| 1605 | |
| 1606 | bool message_tested = false; |
| 1607 | bot.on_message_createcxx . . $ dpp/cluster#on_message_create.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&message_tested, &bot, &message_helper, &thread_helper](const dppcxx . . $ dpp/::message_create_tcxx . . $ dpp/message_create_t# &event) { |
| 1608 | if (event.msgcxx . . $ dpp/message_create_t#msg..authorcxx . . $ dpp/message#author..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). botcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) { |
| 1609 | if (event.msgcxx . . $ dpp/message_create_t#msg..contentcxx . . $ dpp/message#content. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test message" && !message_tested) { |
| 1610 | message_tested = true; |
| 1611 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGERECEIVEcxx . . $ MESSAGERECEIVE., true); |
| 1612 | message_helper.runcxx . . $ main(afcd3168fc1188a4).message_test_helper#run(55ae228098ad4d0d).(event.msgcxx . . $ dpp/message_create_t#msg.); |
| 1613 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGESGETcxx . . $ MESSAGESGET., false); |
| 1614 | bot.messages_getcxx . . $ dpp/cluster#messages_get(125eadf2542fc600).(eventcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..msgcxx . . $ dpp/message_create_t#msg..channel_idcxx . . $ dpp/message#channel_id., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., eventcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..msgcxx . . $ dpp/message_create_t#msg..idcxx . . $ dpp/managed#id., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 5, [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &cc) { |
| 1615 | if (!cc.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1616 | dppcxx . . $ dpp/::message_mapcxx . . $ dpp/message_map# mm = stdcxx . . $ std/unordered_map#unordered_map(d1702721d56b98b0).::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::message_mapcxx . . $ dpp/message_map#>(cc.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 1617 | if (mm.sizecxx . . $ std/unordered_map#size(fe713de6d184c8a).()) { |
| 1618 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGESGETcxx . . $ MESSAGESGET., true); |
| 1619 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMESTAMPcxx . . $ TIMESTAMP., false); |
| 1620 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m = mmcxx . . $ dpp/message#message(55ae228098ad4d0d)..begincxx . . $ std/unordered_map#begin(58ae48d364eea91c).()->cxx . . $ std/__detail/_Node_iterator#`operator->`(35610babf8706b50).secondcxx . . $ std/pair#second.; |
| 1621 | if (m.sentcxx . . $ dpp/message#sent. > 0) { |
| 1622 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMESTAMPcxx . . $ TIMESTAMP., true); |
| 1623 | } else { |
| 1624 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMESTAMPcxx . . $ TIMESTAMP., false); |
| 1625 | } |
| 1626 | } else { |
| 1627 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGESGETcxx . . $ MESSAGESGET., false); |
| 1628 | } |
| 1629 | } else { |
| 1630 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MESSAGESGETcxx . . $ MESSAGESGET., false); |
| 1631 | } |
| 1632 | }); |
| 1633 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MSGCREATESENDcxx . . $ MSGCREATESEND., false); |
| 1634 | event.sendcxx . . $ dpp/message_create_t#send(fd6834981af6b30e).("MSGCREATESEND"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, ch_id = eventcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..msgcxx . . $ dpp/message_create_t#msg..channel_idcxx . . $ dpp/message#channel_id.](const auto &cc) { |
| 1635 | if (!cc.is_error()) { |
| 1636 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# m = stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::messagecxx . . $ dpp/message#>(cc.value); |
| 1637 | if (mcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..channel_idcxx . . $ dpp/message#channel_id. == ch_id) { |
| 1638 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MSGCREATESENDcxx . . $ MSGCREATESEND., true); |
| 1639 | } else { |
| 1640 | bot.logcxx . . $ dpp/cluster#log(7f5f639e8434218f).(dppcxx . . $ dpp/::ll_debugcxx . . $ dpp/ll_debug., cc.http_info.body); |
| 1641 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MSGCREATESENDcxx . . $ MSGCREATESEND., false); |
| 1642 | } |
| 1643 | bot.message_deletecxx . . $ dpp/cluster#message_delete(8674faafcd829b3c).(mcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., mcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..channel_idcxx . . $ dpp/message#channel_id.); |
| 1644 | } else { |
| 1645 | bot.logcxx . . $ dpp/cluster#log(7f5f639e8434218f).(dppcxx . . $ dpp/::ll_debugcxx . . $ dpp/ll_debug., cc.http_info.body); |
| 1646 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MSGCREATESENDcxx . . $ MSGCREATESEND., false); |
| 1647 | } |
| 1648 | }); |
| 1649 | } |
| 1650 | if (event.msgcxx . . $ dpp/message_create_t#msg..channel_idcxx . . $ dpp/message#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id. && event.msgcxx . . $ dpp/message_create_t#msg..contentcxx . . $ dpp/message#content. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "hello thread") { |
| 1651 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_CREATE_EVENTcxx . . $ THREAD_MESSAGE_CREATE_EVENT., true); |
| 1652 | thread_helper.notify_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#notify_event_tested(f1b1972d76c0f663).(thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper#::MESSAGE_CREATEcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_CREATE.); |
| 1653 | } |
| 1654 | } |
| 1655 | }); |
| 1656 | |
| 1657 | bot.on_message_reaction_addcxx . . $ dpp/cluster#on_message_reaction_add.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&bot, &thread_helper](const dppcxx . . $ dpp/::message_reaction_add_tcxx . . $ dpp/message_reaction_add_t# &event) { |
| 1658 | if (event.reacting_usercxx . . $ dpp/message_reaction_add_t#reacting_user..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). botcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) { |
| 1659 | if (event.reacting_emojicxx . . $ dpp/message_reaction_add_t#reacting_emoji..namecxx . . $ dpp/emoji#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "😄") { |
| 1660 | set_testcxx . . $ set_test(c715a584a48bbbaa).(REACTEVENTcxx . . $ REACTEVENT., true); |
| 1661 | } |
| 1662 | if (event.channel_idcxx . . $ dpp/message_reaction_add_t#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id. && event.reacting_emojicxx . . $ dpp/message_reaction_add_t#reacting_emoji..namecxx . . $ dpp/emoji#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). dppcxx . . $ dpp/::unicode_emojicxx . . $ dpp/unicode_emoji/::threadcxx . . $ dpp/unicode_emoji/thread.) { |
| 1663 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_REACT_ADD_EVENTcxx . . $ THREAD_MESSAGE_REACT_ADD_EVENT., true); |
| 1664 | thread_helper.notify_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#notify_event_tested(f1b1972d76c0f663).(thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper#::MESSAGE_REACTcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_REACT.); |
| 1665 | } |
| 1666 | } |
| 1667 | }); |
| 1668 | |
| 1669 | bot.on_message_reaction_removecxx . . $ dpp/cluster#on_message_reaction_remove.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&bot, &thread_helper](const dppcxx . . $ dpp/::message_reaction_remove_tcxx . . $ dpp/message_reaction_remove_t# &event) { |
| 1670 | if (event.reacting_user_idcxx . . $ dpp/message_reaction_remove_t#reacting_user_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). botcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) { |
| 1671 | if (event.channel_idcxx . . $ dpp/message_reaction_remove_t#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id. && event.reacting_emojicxx . . $ dpp/message_reaction_remove_t#reacting_emoji..namecxx . . $ dpp/emoji#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). dppcxx . . $ dpp/::unicode_emojicxx . . $ dpp/unicode_emoji/::threadcxx . . $ dpp/unicode_emoji/thread.) { |
| 1672 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_REACT_REMOVE_EVENTcxx . . $ THREAD_MESSAGE_REACT_REMOVE_EVENT., true); |
| 1673 | thread_helper.notify_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#notify_event_tested(f1b1972d76c0f663).(thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper#::MESSAGE_REMOVE_REACTcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_REMOVE_REACT.); |
| 1674 | } |
| 1675 | } |
| 1676 | }); |
| 1677 | |
| 1678 | bot.on_message_deletecxx . . $ dpp/cluster#on_message_delete.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&thread_helper](const dppcxx . . $ dpp/::message_delete_tcxx . . $ dpp/message_delete_t# &event) { |
| 1679 | if (event.channel_idcxx . . $ dpp/message_delete_t#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id.) { |
| 1680 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_DELETE_EVENTcxx . . $ THREAD_MESSAGE_DELETE_EVENT., true); |
| 1681 | thread_helper.notify_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#notify_event_tested(f1b1972d76c0f663).(thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper#::MESSAGE_DELETEcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_DELETE.); |
| 1682 | } |
| 1683 | }); |
| 1684 | |
| 1685 | bool message_edit_tested = false; |
| 1686 | bot.on_message_updatecxx . . $ dpp/cluster#on_message_update.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&bot, &thread_helper, &message_edit_tested](const dppcxx . . $ dpp/::message_update_tcxx . . $ dpp/message_update_t# &event) { |
| 1687 | if (event.msgcxx . . $ dpp/message_update_t#msg..authorcxx . . $ dpp/message#author. ==cxx . . $ dpp/managed#`operator==`(3fa56817ec02e95). botcxx . . $ dpp/managed#managed(1c8aeb7d200965fe)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) { |
| 1688 | if (event.msgcxx . . $ dpp/message_update_t#msg..contentcxx . . $ dpp/message#content. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test edit" && !message_edit_tested) { |
| 1689 | message_edit_tested = true; |
| 1690 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EDITEVENTcxx . . $ EDITEVENT., true); |
| 1691 | } |
| 1692 | if (event.msgcxx . . $ dpp/message_update_t#msg..channel_idcxx . . $ dpp/message#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id. && event.msgcxx . . $ dpp/message_update_t#msg..contentcxx . . $ dpp/message#content. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "hello thread?") { |
| 1693 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MESSAGE_EDIT_EVENTcxx . . $ THREAD_MESSAGE_EDIT_EVENT., true); |
| 1694 | thread_helper.notify_event_testedcxx . . $ main(afcd3168fc1188a4).thread_test_helper#notify_event_tested(f1b1972d76c0f663).(thread_test_helpercxx . . $ main(afcd3168fc1188a4).thread_test_helper#::MESSAGE_EDITcxx . . $ main(afcd3168fc1188a4).thread_test_helper#MESSAGE_EDIT.); |
| 1695 | } |
| 1696 | } |
| 1697 | }); |
| 1698 | |
| 1699 | bot.on_thread_updatecxx . . $ dpp/cluster#on_thread_update.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&thread_helper](const dppcxx . . $ dpp/::thread_update_tcxx . . $ dpp/thread_update_t# &event) { |
| 1700 | if (event.updating_guildcxx . . $ dpp/thread_update_t#updating_guild..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && event.updatedcxx . . $ dpp/thread_update_t#updated..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id. && event.updatedcxx . . $ dpp/thread_update_t#updated..namecxx . . $ dpp/channel#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "edited") { |
| 1701 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_UPDATE_EVENTcxx . . $ THREAD_UPDATE_EVENT., true); |
| 1702 | } |
| 1703 | }); |
| 1704 | |
| 1705 | bot.on_thread_members_updatecxx . . $ dpp/cluster#on_thread_members_update.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&](const dppcxx . . $ dpp/::thread_members_update_tcxx . . $ dpp/thread_members_update_t# &event) { |
| 1706 | if (event.updating_guildcxx . . $ dpp/thread_members_update_t#updating_guild.->idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && event.thread_idcxx . . $ dpp/thread_members_update_t#thread_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). thread_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).thread_test_helper#thread_id.) { |
| 1707 | if (stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(stdcxx . . $ std/::begincxx . . $ std/begin(3c35d993e5469659).(event.addedcxx . . $ dpp/thread_members_update_t#added.), stdcxx . . $ std/::endcxx . . $ std/end(a99cfb27adea8343).(event.addedcxx . . $ dpp/thread_members_update_t#added.), is_ownercxx . . $ is_owner.) != stdcxx . . $ std/::endcxx . . $ std/end(a99cfb27adea8343).(event.addedcxx . . $ dpp/thread_members_update_t#added.)) { |
| 1708 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBERS_ADD_EVENTcxx . . $ THREAD_MEMBERS_ADD_EVENT., true); |
| 1709 | } |
| 1710 | if (stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).(stdcxx . . $ std/::begincxx . . $ std/begin(3c35d993e5469659).(event.removed_idscxx . . $ dpp/thread_members_update_t#removed_ids.), stdcxx . . $ std/::endcxx . . $ std/end(a99cfb27adea8343).(event.removed_idscxx . . $ dpp/thread_members_update_t#removed_ids.), is_ownercxx . . $ is_owner.) != stdcxx . . $ std/::endcxx . . $ std/end(a99cfb27adea8343).(event.removed_idscxx . . $ dpp/thread_members_update_t#removed_ids.)) { |
| 1711 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_MEMBERS_REMOVE_EVENTcxx . . $ THREAD_MEMBERS_REMOVE_EVENT., true); |
| 1712 | } |
| 1713 | } |
| 1714 | }); |
| 1715 | |
| 1716 | bot.on_thread_deletecxx . . $ dpp/cluster#on_thread_delete.(cxx . . $ dpp/event_router_t#`operator()`(7d840609c6f74506).[&](const dppcxx . . $ dpp/::thread_delete_tcxx . . $ dpp/thread_delete_t# &event) { |
| 1717 | if (event.deleting_guildcxx . . $ dpp/thread_delete_t#deleting_guild..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && event.deletedcxx . . $ dpp/thread_delete_t#deleted..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). message_helpercxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..thread_idcxx . . $ main(afcd3168fc1188a4).message_test_helper#thread_id.) { |
| 1718 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_DELETE_EVENTcxx . . $ THREAD_DELETE_EVENT., true); |
| 1719 | } |
| 1720 | }); |
| 1721 | |
| 1722 | // set to execute from this thread (main thread) after on_ready is fired |
| 1723 | auto do_online_tests = [&] { |
| 1724 | coro_online_testscxx . . $ coro_online_tests(a8df4c8451c92bc4).(&bot); |
| 1725 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_CREATEcxx . . $ GUILD_BAN_CREATE., false); |
| 1726 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_GETcxx . . $ GUILD_BAN_GET., false); |
| 1727 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BANS_GETcxx . . $ GUILD_BANS_GET., false); |
| 1728 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_DELETEcxx . . $ GUILD_BAN_DELETE., false); |
| 1729 | if (!offlinecxx . . $ offline.) { |
| 1730 | // some discord accounts to test the ban stuff with... |
| 1731 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# deadUser1cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).(155149108183695360); // Dyno |
| 1732 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# deadUser2cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).(159985870458322944); // MEE6 |
| 1733 | dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake# deadUser3cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).(936929561302675456); // MidJourney Bot |
| 1734 | |
| 1735 | bot.set_audit_reasoncxx . . $ dpp/cluster#set_audit_reason(d697297e704d91f5).("ban reason one"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).).guild_ban_addcxx . . $ dpp/cluster#guild_ban_add(d284812cade9bdc5).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., 0, [cxx . . $ std/function#function(bdc3712e480e4d04).deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., &bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1736 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) |
| 1737 | bot.guild_ban_addcxx . . $ dpp/cluster#guild_ban_add(d284812cade9bdc5).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., 0, [cxx . . $ std/function#function(bdc3712e480e4d04).deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., &bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1738 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) |
| 1739 | bot.set_audit_reasoncxx . . $ dpp/cluster#set_audit_reason(d697297e704d91f5).("ban reason three"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).).guild_ban_addcxx . . $ dpp/cluster#guild_ban_add(d284812cade9bdc5).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., 0, [cxx . . $ std/function#function(bdc3712e480e4d04).deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., &bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1740 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1741 | return; |
| 1742 | } |
| 1743 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_CREATEcxx . . $ GUILD_BAN_CREATE., true); |
| 1744 | |
| 1745 | // get ban |
| 1746 | bot.guild_get_bancxx . . $ dpp/cluster#guild_get_ban(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1747 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1748 | dppcxx . . $ dpp/::bancxx . . $ dpp/ban# ban = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::bancxx . . $ dpp/ban#>(); |
| 1749 | // Check the audit reason was set correctly |
| 1750 | if (bancxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..user_idcxx . . $ dpp/ban#user_id. == deadUser1 && ban.reasoncxx . . $ dpp/ban#reason. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "ban reason one") { |
| 1751 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_GETcxx . . $ GUILD_BAN_GET., true); |
| 1752 | } else { |
| 1753 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_GETcxx . . $ GUILD_BAN_GET., false); |
| 1754 | } |
| 1755 | // get all bans after deadUser1 |
| 1756 | bot.guild_get_banscxx . . $ dpp/cluster#guild_get_bans(28d355e1c5d1679).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., 50cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1757 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1758 | auto bans = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::ban_mapcxx . . $ dpp/ban_map#>(); |
| 1759 | // The ban set should contain at least two bans, two of which should be deadUser2 and deadUser3, |
| 1760 | // but never deadUser1. Take into account that *other bans* might exist in the list so we can't |
| 1761 | // just assume there are three or set a limit of 3 above. |
| 1762 | set_testcxx . . $ set_test(c715a584a48bbbaa).( |
| 1763 | GUILD_BANS_GETcxx . . $ GUILD_BANS_GET., |
| 1764 | bans.findcxx . . $ std/unordered_map#find(f711f2f81556fe93).(deadUser1) ==cxx . . $ std/__detail/`operator==`(e1037da44eedfa38). bans.endcxx . . $ std/unordered_map#end(58ae48d364eea91c).() |
| 1765 | && bans.findcxx . . $ std/unordered_map#find(f711f2f81556fe93).(deadUser2) != bans.endcxx . . $ std/unordered_map#end(58ae48d364eea91c).() |
| 1766 | && bans.findcxx . . $ std/unordered_map#find(f711f2f81556fe93).(deadUser3) != bans.endcxx . . $ std/unordered_map#end(58ae48d364eea91c).() |
| 1767 | ); |
| 1768 | // unban all three |
| 1769 | bot.guild_ban_deletecxx . . $ dpp/cluster#guild_ban_delete(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser1cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1770 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1771 | bot.guild_ban_deletecxx . . $ dpp/cluster#guild_ban_delete(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser2cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1772 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1773 | bot.guild_ban_deletecxx . . $ dpp/cluster#guild_ban_delete(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., deadUser3cxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1774 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1775 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_DELETEcxx . . $ GUILD_BAN_DELETE., true); |
| 1776 | } else { |
| 1777 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_DELETEcxx . . $ GUILD_BAN_DELETE., false); |
| 1778 | } |
| 1779 | }); |
| 1780 | } else { |
| 1781 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_DELETEcxx . . $ GUILD_BAN_DELETE., false); |
| 1782 | } |
| 1783 | }); |
| 1784 | } else { |
| 1785 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_DELETEcxx . . $ GUILD_BAN_DELETE., false); |
| 1786 | } |
| 1787 | }); |
| 1788 | } else { |
| 1789 | /* An error in this test cascades to others failing immediately */ |
| 1790 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BANS_GETcxx . . $ GUILD_BANS_GET., false); |
| 1791 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_DELETEcxx . . $ GUILD_BAN_DELETE., false); |
| 1792 | } |
| 1793 | }); |
| 1794 | } else { |
| 1795 | /* An error in the parent test cascades to the others failing immediately */ |
| 1796 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_GETcxx . . $ GUILD_BAN_GET., false); |
| 1797 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BANS_GETcxx . . $ GUILD_BANS_GET., false); |
| 1798 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GUILD_BAN_DELETEcxx . . $ GUILD_BAN_DELETE., false); |
| 1799 | } |
| 1800 | }); |
| 1801 | }); |
| 1802 | }); |
| 1803 | }); |
| 1804 | } |
| 1805 | |
| 1806 | set_testcxx . . $ set_test(c715a584a48bbbaa).(REQUEST_GET_IMAGEcxx . . $ REQUEST_GET_IMAGE., false); |
| 1807 | if (!offlinecxx . . $ offline.) { |
| 1808 | bot.requestcxx . . $ dpp/cluster#request(1cf518fcdc14904e).("https://dpp.dev/DPP-Logo.png"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., dppcxx . . $ dpp/::m_getcxx . . $ dpp/m_get., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot](const dppcxx . . $ dpp/::http_request_completion_tcxx . . $ dpp/http_request_completion_t# &callback) { |
| 1809 | if (callback.statuscxx . . $ dpp/http_request_completion_t#status. != 200) { |
| 1810 | return; |
| 1811 | } |
| 1812 | set_testcxx . . $ set_test(c715a584a48bbbaa).(REQUEST_GET_IMAGEcxx . . $ REQUEST_GET_IMAGE., true); |
| 1813 | |
| 1814 | dppcxx . . $ dpp/::emojicxx . . $ dpp/emoji# emojicxx . . $ dpp/emoji#emoji(ced63f7c635d850d).; |
| 1815 | emoji.load_imagecxx . . $ dpp/emoji#load_image(fcbcdaaa3cd56b17).(callback.bodycxx . . $ dpp/http_request_completion_t#body., dppcxx . . $ dpp/::i_pngcxx . . $ dpp/i_png.); |
| 1816 | emoji.namecxx . . $ dpp/emoji#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "dpp"; |
| 1817 | |
| 1818 | // emoji unit test with the requested image |
| 1819 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_CREATEcxx . . $ EMOJI_CREATE., false); |
| 1820 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_GETcxx . . $ EMOJI_GET., false); |
| 1821 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_DELETEcxx . . $ EMOJI_DELETE., false); |
| 1822 | bot.guild_emoji_createcxx . . $ dpp/cluster#guild_emoji_create(ca3447625c4ee180).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., emoji, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1823 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1824 | return; |
| 1825 | } |
| 1826 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_CREATEcxx . . $ EMOJI_CREATE., true); |
| 1827 | |
| 1828 | auto created = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::emojicxx . . $ dpp/emoji#>(); |
| 1829 | bot.guild_emoji_getcxx . . $ dpp/cluster#guild_emoji_get(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., createdcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, createdcxx . . $ dpp/emoji#emoji(9aa6039c166b416c).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1830 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1831 | return; |
| 1832 | } |
| 1833 | auto fetched = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::emojicxx . . $ dpp/emoji#>(); |
| 1834 | if (created.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). fetchedcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id. && created.namecxx . . $ dpp/emoji#name. ==cxx . . $ std/`operator==`(5ea818b58063a774). fetched.namecxx . . $ dpp/emoji#name. && created.flagscxx . . $ dpp/emoji#flags. == fetched.flagscxx . . $ dpp/emoji#flags.) { |
| 1835 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_GETcxx . . $ EMOJI_GET., true); |
| 1836 | } |
| 1837 | |
| 1838 | bot.guild_emoji_deletecxx . . $ dpp/cluster#guild_emoji_delete(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., fetchedcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1839 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1840 | set_testcxx . . $ set_test(c715a584a48bbbaa).(EMOJI_DELETEcxx . . $ EMOJI_DELETE., true); |
| 1841 | } |
| 1842 | }); |
| 1843 | }); |
| 1844 | }); |
| 1845 | }); |
| 1846 | } |
| 1847 | |
| 1848 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_CREATEcxx . . $ INVITE_CREATE., false); |
| 1849 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_GETcxx . . $ INVITE_GET., false); |
| 1850 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_DELETEcxx . . $ INVITE_DELETE., false); |
| 1851 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GETCHANNELINVScxx . . $ GETCHANNELINVS., false); |
| 1852 | if (!offlinecxx . . $ offline.) { |
| 1853 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# channelcxx . . $ dpp/channel#channel(49f6e7a06ebc5aa8).; |
| 1854 | channel.idcxx . . $ dpp/managed#id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). TEST_TEXT_CHANNEL_IDcxx . . $ TEST_TEXT_CHANNEL_ID.; |
| 1855 | dppcxx . . $ dpp/::invitecxx . . $ dpp/invite# invitecxx . . $ dpp/invite#invite(49f6e7a06ebc5aa8).; |
| 1856 | invite.max_agecxx . . $ dpp/invite#max_age. = 0; |
| 1857 | invite.max_usescxx . . $ dpp/invite#max_uses. = 100; |
| 1858 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_CREATE_EVENTcxx . . $ INVITE_CREATE_EVENT., false); |
| 1859 | bot.channel_invite_createcxx . . $ dpp/cluster#channel_invite_create(2e9657b19fcf4eb6).(channel, invite, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, channel, invite](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1860 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1861 | return; |
| 1862 | } |
| 1863 | |
| 1864 | auto created = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::invitecxx . . $ dpp/invite#>(); |
| 1865 | if (!created.codecxx . . $ dpp/invite#code..emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).() && created.channel_idcxx . . $ dpp/invite#channel_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && created.guild_idcxx . . $ dpp/invite#guild_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && created.invitercxx . . $ dpp/invite#inviter..idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). botcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..mecxx . . $ dpp/cluster#me..idcxx . . $ dpp/managed#id.) { |
| 1866 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_CREATEcxx . . $ INVITE_CREATE., true); |
| 1867 | } |
| 1868 | |
| 1869 | bot.channel_invites_getcxx . . $ dpp/cluster#channel_invites_get(118b3622110f49).(channel, [cxx . . $ std/function#function(bdc3712e480e4d04).created](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1870 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1871 | return; |
| 1872 | } |
| 1873 | |
| 1874 | auto invites = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::invite_mapcxx . . $ dpp/invite_map#>(); |
| 1875 | if (!invites.emptycxx . . $ std/unordered_map#empty(3482b152b9333168).() && invites.findcxx . . $ std/unordered_map#find(f711f2f81556fe93).(created.codecxx . . $ dpp/invite#code.) != invites.endcxx . . $ std/unordered_map#end(58ae48d364eea91c).()) { |
| 1876 | set_testcxx . . $ set_test(c715a584a48bbbaa).(GETCHANNELINVScxx . . $ GETCHANNELINVS., true); |
| 1877 | } |
| 1878 | }); |
| 1879 | |
| 1880 | bot.invite_getcxx . . $ dpp/cluster#invite_get(eb47316530df229e).(created.codecxx . . $ dpp/invite#code., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, created](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1881 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1882 | auto retrieved = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::invitecxx . . $ dpp/invite#>(); |
| 1883 | if (retrieved.codecxx . . $ dpp/invite#code. ==cxx . . $ std/`operator==`(5ea818b58063a774). created.codecxx . . $ dpp/invite#code. && retrievedcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..guild_idcxx . . $ dpp/invite#guild_id. == created.guild_idcxx . . $ dpp/invite#guild_id. && retrievedcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..channel_idcxx . . $ dpp/invite#channel_id. == created.channel_idcxx . . $ dpp/invite#channel_id. && retrievedcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..invitercxx . . $ dpp/invite#inviter..idcxx . . $ dpp/managed#id. == created.invitercxx . . $ dpp/invite#inviter..idcxx . . $ dpp/managed#id.) { |
| 1884 | if (retrieved.destination_guildcxx . . $ dpp/invite#destination_guild..flagscxx . . $ dpp/guild#flags. & dppcxx . . $ dpp/::g_communitycxx . . $ dpp/g_community.) { |
| 1885 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_GETcxx . . $ INVITE_GET., retrieved.expires_atcxx . . $ dpp/invite#expires_at. == 0); |
| 1886 | } else { |
| 1887 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_GETcxx . . $ INVITE_GET., true); |
| 1888 | } |
| 1889 | |
| 1890 | } else { |
| 1891 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_GETcxx . . $ INVITE_GET., false); |
| 1892 | } |
| 1893 | } else { |
| 1894 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_GETcxx . . $ INVITE_GET., false); |
| 1895 | } |
| 1896 | |
| 1897 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_DELETE_EVENTcxx . . $ INVITE_DELETE_EVENT., false); |
| 1898 | bot.invite_deletecxx . . $ dpp/cluster#invite_delete(eb47316530df229e).(created.codecxx . . $ dpp/invite#code., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1899 | set_testcxx . . $ set_test(c715a584a48bbbaa).(INVITE_DELETEcxx . . $ INVITE_DELETE., !event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()); |
| 1900 | }); |
| 1901 | }); |
| 1902 | }); |
| 1903 | } |
| 1904 | |
| 1905 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_CREATEcxx . . $ AUTOMOD_RULE_CREATE., false); |
| 1906 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_GETcxx . . $ AUTOMOD_RULE_GET., false); |
| 1907 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_GET_ALLcxx . . $ AUTOMOD_RULE_GET_ALL., false); |
| 1908 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_DELETEcxx . . $ AUTOMOD_RULE_DELETE., false); |
| 1909 | if (!offlinecxx . . $ offline.) { |
| 1910 | dppcxx . . $ dpp/::automod_rulecxx . . $ dpp/automod_rule# automodRulecxx . . $ dpp/automod_rule#automod_rule(49f6e7a06ebc5aa8).; |
| 1911 | automodRule.namecxx . . $ dpp/automod_rule#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "automod rule (keyword type)"; |
| 1912 | automodRule.trigger_typecxx . . $ dpp/automod_rule#trigger_type. = dppcxx . . $ dpp/::amod_type_keywordcxx . . $ dpp/amod_type_keyword.; |
| 1913 | dppcxx . . $ dpp/::automod_metadatacxx . . $ dpp/automod_metadata# metadata1cxx . . $ dpp/automod_metadata#automod_metadata(49f6e7a06ebc5aa8).; |
| 1914 | metadata1.keywordscxx . . $ dpp/automod_metadata#keywords..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).("*cat*"); |
| 1915 | metadata1.keywordscxx . . $ dpp/automod_metadata#keywords..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).("train"); |
| 1916 | metadata1.keywordscxx . . $ dpp/automod_metadata#keywords..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).("*.exe"); |
| 1917 | metadata1.regex_patternscxx . . $ dpp/automod_metadata#regex_patterns..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).("^[^a-z]$"); |
| 1918 | metadata1.allow_listcxx . . $ dpp/automod_metadata#allow_list..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).("@silent*"); |
| 1919 | automodRule.trigger_metadatacxx . . $ dpp/automod_rule#trigger_metadata. =cxx . . $ dpp/automod_metadata#`operator=`(375d3004b1405f00). metadata1; |
| 1920 | dppcxx . . $ dpp/::automod_actioncxx . . $ dpp/automod_action# automodActioncxx . . $ dpp/automod_action#automod_action(49f6e7a06ebc5aa8).; |
| 1921 | automodAction.typecxx . . $ dpp/automod_action#type. = dppcxx . . $ dpp/::amod_action_timeoutcxx . . $ dpp/amod_action_timeout.; |
| 1922 | automodAction.duration_secondscxx . . $ dpp/automod_action#duration_seconds. = 6000; |
| 1923 | automodRule.actionscxx . . $ dpp/automod_rule#actions..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(automodAction); |
| 1924 | |
| 1925 | bot.automod_rules_getcxx . . $ dpp/cluster#automod_rules_get(f0cdb3822bb61a0b).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, automodRule](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1926 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1927 | return; |
| 1928 | } |
| 1929 | auto rules = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::automod_rule_mapcxx . . $ dpp/automod_rule_map#>(); |
| 1930 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_GET_ALLcxx . . $ AUTOMOD_RULE_GET_ALL., true); |
| 1931 | for (const auto &rule: rules) { |
| 1932 | if (rule.secondcxx . . $ std/pair#second..trigger_typecxx . . $ dpp/automod_rule#trigger_type. == dppcxx . . $ dpp/::amod_type_keywordcxx . . $ dpp/amod_type_keyword.) { |
| 1933 | // delete one automod rule of type KEYWORD before creating one to make space... |
| 1934 | bot.automod_rule_deletecxx . . $ dpp/cluster#automod_rule_delete(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., rulecxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..firstcxx . . $ std/pair#first.); |
| 1935 | } |
| 1936 | } |
| 1937 | |
| 1938 | // start creating the automod rules |
| 1939 | bot.automod_rule_createcxx . . $ dpp/cluster#automod_rule_create(705e676eb7708e09).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., automodRule, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, automodRule](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1940 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1941 | return; |
| 1942 | } |
| 1943 | auto created = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::automod_rulecxx . . $ dpp/automod_rule#>(); |
| 1944 | if (created.namecxx . . $ dpp/automod_rule#name. ==cxx . . $ std/`operator==`(5ea818b58063a774). automodRule.namecxx . . $ dpp/automod_rule#name.) { |
| 1945 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_CREATEcxx . . $ AUTOMOD_RULE_CREATE., true); |
| 1946 | } |
| 1947 | |
| 1948 | // get automod rule |
| 1949 | bot.automod_rule_getcxx . . $ dpp/cluster#automod_rule_get(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., createdcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/automod_rule#id., [cxx . . $ std/function#function(bdc3712e480e4d04).automodRule, &bot, created](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1950 | if (event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1951 | return; |
| 1952 | } |
| 1953 | auto retrieved = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::automod_rulecxx . . $ dpp/automod_rule#>(); |
| 1954 | if (retrieved.namecxx . . $ dpp/automod_rule#name. ==cxx . . $ std/`operator==`(5ea818b58063a774). automodRule.namecxx . . $ dpp/automod_rule#name. && |
| 1955 | retrieved.trigger_typecxx . . $ dpp/automod_rule#trigger_type. == automodRule.trigger_typecxx . . $ dpp/automod_rule#trigger_type. && |
| 1956 | retrieved.trigger_metadatacxx . . $ dpp/automod_rule#trigger_metadata..keywordscxx . . $ dpp/automod_metadata#keywords. ==cxx . . $ std/`operator==`(a0a51a13f7e42509). automodRule.trigger_metadatacxx . . $ dpp/automod_rule#trigger_metadata..keywordscxx . . $ dpp/automod_metadata#keywords. && |
| 1957 | retrieved.trigger_metadatacxx . . $ dpp/automod_rule#trigger_metadata..regex_patternscxx . . $ dpp/automod_metadata#regex_patterns. ==cxx . . $ std/`operator==`(a0a51a13f7e42509). automodRule.trigger_metadatacxx . . $ dpp/automod_rule#trigger_metadata..regex_patternscxx . . $ dpp/automod_metadata#regex_patterns. && |
| 1958 | retrieved.trigger_metadatacxx . . $ dpp/automod_rule#trigger_metadata..allow_listcxx . . $ dpp/automod_metadata#allow_list. ==cxx . . $ std/`operator==`(a0a51a13f7e42509). automodRule.trigger_metadatacxx . . $ dpp/automod_rule#trigger_metadata..allow_listcxx . . $ dpp/automod_metadata#allow_list. && retrieved.actionscxx . . $ dpp/automod_rule#actions..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() == automodRule.actionscxx . . $ dpp/automod_rule#actions..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).()) { |
| 1959 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_GETcxx . . $ AUTOMOD_RULE_GET., true); |
| 1960 | } |
| 1961 | |
| 1962 | // delete the automod rule |
| 1963 | bot.automod_rule_deletecxx . . $ dpp/cluster#automod_rule_delete(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., retrievedcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/automod_rule#id., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1964 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1965 | set_testcxx . . $ set_test(c715a584a48bbbaa).(AUTOMOD_RULE_DELETEcxx . . $ AUTOMOD_RULE_DELETE., true); |
| 1966 | } |
| 1967 | }); |
| 1968 | }); |
| 1969 | }); |
| 1970 | }); |
| 1971 | } |
| 1972 | |
| 1973 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GETcxx . . $ USER_GET., false); |
| 1974 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_FLAGScxx . . $ USER_GET_FLAGS., false); |
| 1975 | if (!offlinecxx . . $ offline.) { |
| 1976 | bot.user_getcxx . . $ dpp/cluster#user_get(f0cdb3822bb61a0b).(TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 1977 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 1978 | auto u = stdcxx . . $ std/::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::user_identifiedcxx . . $ dpp/user_identified#>(event.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 1979 | if (u.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).) { |
| 1980 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GETcxx . . $ USER_GET., true); |
| 1981 | } else { |
| 1982 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GETcxx . . $ USER_GET., false); |
| 1983 | } |
| 1984 | jsoncxx . . $ json# j = jsoncxx . . $ json#::parsecxx . . $ nlohmann/json_abi_v3_11_3/basic_json#parse(7815a10c7f5973d5).(event.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body.); |
| 1985 | uint64_tcxx . . $ uint64_t# raw_flags = j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."public_flags"]; |
| 1986 | if (j.containscxx . . $ nlohmann/json_abi_v3_11_3/basic_json#contains(6573c7f34fbbc96d).("flags")) { |
| 1987 | uint64_tcxx . . $ uint64_t# flags = j[cxx . . $ nlohmann/json_abi_v3_11_3/basic_json#`operator[]`(20f28fa18fb3cd78)."flags"]; |
| 1988 | raw_flags |= flags; |
| 1989 | } |
| 1990 | // testing all user flags from https://discord.com/developers/docs/resources/user#user-object-user-flags |
| 1991 | // they're manually set here because the dpp::user_flags don't match to the discord API, so we can't use them to compare with the raw flags! |
| 1992 | if ( |
| 1993 | u.is_discord_employeecxx . . $ dpp/user#is_discord_employee(50ce9a9e25b4a850).() == ((raw_flags & (1 << 0)) != 0) && |
| 1994 | u.is_partnered_ownercxx . . $ dpp/user#is_partnered_owner(50ce9a9e25b4a850).() == ((raw_flags & (1 << 1)) != 0) && |
| 1995 | u.has_hypesquad_eventscxx . . $ dpp/user#has_hypesquad_events(50ce9a9e25b4a850).() == ((raw_flags & (1 << 2)) != 0) && |
| 1996 | u.is_bughunter_1cxx . . $ dpp/user#is_bughunter_1(50ce9a9e25b4a850).() == ((raw_flags & (1 << 3)) != 0) && |
| 1997 | u.is_house_braverycxx . . $ dpp/user#is_house_bravery(50ce9a9e25b4a850).() == ((raw_flags & (1 << 6)) != 0) && |
| 1998 | u.is_house_brilliancecxx . . $ dpp/user#is_house_brilliance(50ce9a9e25b4a850).() == ((raw_flags & (1 << 7)) != 0) && |
| 1999 | u.is_house_balancecxx . . $ dpp/user#is_house_balance(50ce9a9e25b4a850).() == ((raw_flags & (1 << 8)) != 0) && |
| 2000 | u.is_early_supportercxx . . $ dpp/user#is_early_supporter(50ce9a9e25b4a850).() == ((raw_flags & (1 << 9)) != 0) && |
| 2001 | u.is_team_usercxx . . $ dpp/user#is_team_user(50ce9a9e25b4a850).() == ((raw_flags & (1 << 10)) != 0) && |
| 2002 | u.is_bughunter_2cxx . . $ dpp/user#is_bughunter_2(50ce9a9e25b4a850).() == ((raw_flags & (1 << 14)) != 0) && |
| 2003 | u.is_verified_botcxx . . $ dpp/user#is_verified_bot(50ce9a9e25b4a850).() == ((raw_flags & (1 << 16)) != 0) && |
| 2004 | u.is_verified_bot_devcxx . . $ dpp/user#is_verified_bot_dev(50ce9a9e25b4a850).() == ((raw_flags & (1 << 17)) != 0) && |
| 2005 | u.is_certified_moderatorcxx . . $ dpp/user#is_certified_moderator(50ce9a9e25b4a850).() == ((raw_flags & (1 << 18)) != 0) && |
| 2006 | u.is_bot_http_interactionscxx . . $ dpp/user#is_bot_http_interactions(50ce9a9e25b4a850).() == ((raw_flags & (1 << 19)) != 0) && |
| 2007 | u.is_active_developercxx . . $ dpp/user#is_active_developer(50ce9a9e25b4a850).() == ((raw_flags & (1 << 22)) != 0) |
| 2008 | ) { |
| 2009 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_FLAGScxx . . $ USER_GET_FLAGS., true); |
| 2010 | } else { |
| 2011 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_FLAGScxx . . $ USER_GET_FLAGS., false); |
| 2012 | } |
| 2013 | } else { |
| 2014 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GETcxx . . $ USER_GET., false); |
| 2015 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_FLAGScxx . . $ USER_GET_FLAGS., false); |
| 2016 | } |
| 2017 | }); |
| 2018 | } |
| 2019 | |
| 2020 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_CREATEcxx . . $ VOICE_CHANNEL_CREATE., false); |
| 2021 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_EDITcxx . . $ VOICE_CHANNEL_EDIT., false); |
| 2022 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_DELETEcxx . . $ VOICE_CHANNEL_DELETE., false); |
| 2023 | if (!offlinecxx . . $ offline.) { |
| 2024 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# channel1cxx . . $ dpp/channel#channel(49f6e7a06ebc5aa8).; |
| 2025 | channel1.set_typecxx . . $ dpp/channel#set_type(3ebf8b74a0f3745f).(dppcxx . . $ dpp/::CHANNEL_VOICEcxx . . $ dpp/CHANNEL_VOICE.) |
| 2026 | .set_guild_idcxx . . $ dpp/channel#set_guild_id(a609fc442f3ac1c5).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).) |
| 2027 | .set_namecxx . . $ dpp/channel#set_name(f065d923899d215c).("voice1"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).) |
| 2028 | .add_permission_overwritecxx . . $ dpp/channel#add_permission_overwrite(ecdd95d68109a616).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., dppcxx . . $ dpp/::ot_rolecxx . . $ dpp/ot_role., 0, dppcxx . . $ dpp/::p_view_channelcxx . . $ dpp/p_view_channel.) |
| 2029 | .set_user_limitcxx . . $ dpp/channel#set_user_limit(5be055f8fc46cef0).(99); |
| 2030 | bot.channel_createcxx . . $ dpp/cluster#channel_create(118b3622110f49).(channel1, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, channel1](const auto &response) { |
| 2031 | if (response.is_error()) { |
| 2032 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_CREATEcxx . . $ VOICE_CHANNEL_CREATE., false); |
| 2033 | return; |
| 2034 | } |
| 2035 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# createdChannel = stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::channelcxx . . $ dpp/channel#>(response.value); |
| 2036 | if (createdChannel.namecxx . . $ dpp/channel#name. ==cxx . . $ std/`operator==`(5ea818b58063a774). channel1.namecxx . . $ dpp/channel#name. && createdChannel.user_limitcxx . . $ dpp/channel#user_limit. == 99 && createdChannel.namecxx . . $ dpp/channel#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "voice1") { |
| 2037 | for (auto overwrite: createdChannel.permission_overwritescxx . . $ dpp/channel#permission_overwrites.) { |
| 2038 | if (overwrite.idcxx . . $ dpp/permission_overwrite#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && overwrite.typecxx . . $ dpp/permission_overwrite#type. == dppcxx . . $ dpp/::ot_rolecxx . . $ dpp/ot_role. && overwrite.denycxx . . $ dpp/permission_overwrite#deny. == dppcxx . . $ dpp/::p_view_channelcxx . . $ dpp/p_view_channel.) { |
| 2039 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_CREATEcxx . . $ VOICE_CHANNEL_CREATE., true); |
| 2040 | break; |
| 2041 | } |
| 2042 | } |
| 2043 | |
| 2044 | // edit the voice channel |
| 2045 | createdChannel.set_namecxx . . $ dpp/channel#set_name(f065d923899d215c).("foobar2"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 2046 | createdChannel.set_user_limitcxx . . $ dpp/channel#set_user_limit(5be055f8fc46cef0).(2); |
| 2047 | for (auto overwrite: createdChannel.permission_overwritescxx . . $ dpp/channel#permission_overwrites.) { |
| 2048 | if (overwrite.idcxx . . $ dpp/permission_overwrite#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).) { |
| 2049 | overwrite.denycxx . . $ dpp/permission_overwrite#deny..setcxx . . $ dpp/permission#set(8250ce5853a47440).(0); |
| 2050 | overwrite.allowcxx . . $ dpp/permission_overwrite#allow..setcxx . . $ dpp/permission#set(8250ce5853a47440).(dppcxx . . $ dpp/::p_view_channelcxx . . $ dpp/p_view_channel.); |
| 2051 | } |
| 2052 | } |
| 2053 | bot.channel_editcxx . . $ dpp/cluster#channel_edit(118b3622110f49).(createdChannel, [&bot, createdChannel](const auto &response) { |
| 2054 | if (response.is_error()) { |
| 2055 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_EDITcxx . . $ VOICE_CHANNEL_EDIT., false); |
| 2056 | return; |
| 2057 | } |
| 2058 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# edited = stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::channelcxx . . $ dpp/channel#>(response.value); |
| 2059 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_EDITcxx . . $ VOICE_CHANNEL_EDIT., (edited.namecxx . . $ dpp/channel#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "foobar2" && edited.user_limitcxx . . $ dpp/channel#user_limit. == 2)); |
| 2060 | bot.channel_deletecxx . . $ dpp/cluster#channel_delete(f0cdb3822bb61a0b).(createdChannel.idcxx . . $ dpp/managed#id., [](const auto &response) { |
| 2061 | set_testcxx . . $ set_test(c715a584a48bbbaa).(VOICE_CHANNEL_DELETEcxx . . $ VOICE_CHANNEL_DELETE., !response.is_error()); |
| 2062 | }); |
| 2063 | }); |
| 2064 | } |
| 2065 | }); |
| 2066 | } |
| 2067 | |
| 2068 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CREATIONcxx . . $ FORUM_CREATION., false); |
| 2069 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CHANNEL_GETcxx . . $ FORUM_CHANNEL_GET., false); |
| 2070 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CHANNEL_DELETEcxx . . $ FORUM_CHANNEL_DELETE., false); |
| 2071 | if (!offlinecxx . . $ offline.) { |
| 2072 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# ccxx . . $ dpp/channel#channel(49f6e7a06ebc5aa8).; |
| 2073 | c.namecxx . . $ dpp/channel#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "test-forum-channel"; |
| 2074 | c.guild_idcxx . . $ dpp/channel#guild_id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). TEST_GUILD_IDcxx . . $ TEST_GUILD_ID.; |
| 2075 | c.set_topiccxx . . $ dpp/channel#set_topic(f065d923899d215c).("This is a forum channel"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 2076 | c.set_flagscxx . . $ dpp/channel#set_flags(96e87d3ac0704992).(dppcxx . . $ dpp/::CHANNEL_FORUMcxx . . $ dpp/CHANNEL_FORUM.); |
| 2077 | c.default_sort_ordercxx . . $ dpp/channel#default_sort_order. = dppcxx . . $ dpp/::so_creation_datecxx . . $ dpp/so_creation_date.; |
| 2078 | dppcxx . . $ dpp/::forum_tagcxx . . $ dpp/forum_tag# tcxx . . $ dpp/forum_tag#forum_tag(49f6e7a06ebc5aa8).; |
| 2079 | t.namecxx . . $ dpp/forum_tag#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "Alpha"; |
| 2080 | t.emojicxx . . $ dpp/forum_tag#emoji. =cxx . . $ std/variant#`operator=`(2aa1a927971a6116). "❌"; |
| 2081 | c.available_tagscxx . . $ dpp/channel#available_tags. =cxx . . $ std/vector#`operator=`(134e05886416f404). {t}; |
| 2082 | c.default_auto_archive_durationcxx . . $ dpp/channel#default_auto_archive_duration. = dppcxx . . $ dpp/::arc_1_daycxx . . $ dpp/arc_1_day.; |
| 2083 | c.default_reactioncxx . . $ dpp/channel#default_reaction. =cxx . . $ std/variant#`operator=`(2aa1a927971a6116). "✅"; |
| 2084 | c.default_thread_rate_limit_per_usercxx . . $ dpp/channel#default_thread_rate_limit_per_user. = 10; |
| 2085 | bot.channel_createcxx . . $ dpp/cluster#channel_create(118b3622110f49).(c, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 2086 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2087 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CREATIONcxx . . $ FORUM_CREATION., true); |
| 2088 | auto channel = stdcxx . . $ std/::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::channelcxx . . $ dpp/channel#>(event.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 2089 | // retrieve the forum channel and check the values |
| 2090 | bot.channel_getcxx . . $ dpp/cluster#channel_get(f0cdb3822bb61a0b).(channelcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., [cxx . . $ std/function#function(bdc3712e480e4d04).forum_id = channelcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., &bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 2091 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2092 | auto channel = stdcxx . . $ std/::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::channelcxx . . $ dpp/channel#>(event.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 2093 | bot.logcxx . . $ dpp/cluster#log(7f5f639e8434218f).(dppcxx . . $ dpp/::ll_debugcxx . . $ dpp/ll_debug., event.http_infocxx . . $ dpp/confirmation_callback_t#http_info..bodycxx . . $ dpp/http_request_completion_t#body.); |
| 2094 | bool tag = false; |
| 2095 | for (auto &t: channel.available_tagscxx . . $ dpp/channel#available_tags.) { |
| 2096 | if (t.namecxx . . $ dpp/forum_tag#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "Alpha" && stdcxx . . $ std/::holds_alternativecxx . . $ std/holds_alternative(4d382a1a2d74a3ce).<stdcxx . . $ std/::stringcxx . . $ std/string#>(t.emojicxx . . $ dpp/forum_tag#emoji.) && stdcxx . . $ std/::getcxx . . $ std/get(55ed64a6518b24d0).<stdcxx . . $ std/::stringcxx . . $ std/string#>(t.emojicxx . . $ dpp/forum_tag#emoji.) ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "❌") { |
| 2097 | tag = true; |
| 2098 | } |
| 2099 | } |
| 2100 | bool name = channel.namecxx . . $ dpp/channel#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "test-forum-channel"; |
| 2101 | bool sort = channel.default_sort_ordercxx . . $ dpp/channel#default_sort_order. == dppcxx . . $ dpp/::so_creation_datecxx . . $ dpp/so_creation_date.; |
| 2102 | bool rateLimit = channel.default_thread_rate_limit_per_usercxx . . $ dpp/channel#default_thread_rate_limit_per_user. == 10; |
| 2103 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CHANNEL_GETcxx . . $ FORUM_CHANNEL_GET., tag && name && sort && rateLimit); |
| 2104 | } else { |
| 2105 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CHANNEL_GETcxx . . $ FORUM_CHANNEL_GET., false); |
| 2106 | } |
| 2107 | // delete the forum channel |
| 2108 | bot.channel_deletecxx . . $ dpp/cluster#channel_delete(f0cdb3822bb61a0b).(forum_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 2109 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2110 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CHANNEL_DELETEcxx . . $ FORUM_CHANNEL_DELETE., true); |
| 2111 | } else { |
| 2112 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CHANNEL_DELETEcxx . . $ FORUM_CHANNEL_DELETE., false); |
| 2113 | } |
| 2114 | }); |
| 2115 | }); |
| 2116 | } else { |
| 2117 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CREATIONcxx . . $ FORUM_CREATION., false); |
| 2118 | set_testcxx . . $ set_test(c715a584a48bbbaa).(FORUM_CHANNEL_GETcxx . . $ FORUM_CHANNEL_GET., false); |
| 2119 | } |
| 2120 | }); |
| 2121 | } |
| 2122 | |
| 2123 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_CREATEcxx . . $ THREAD_CREATE., false); |
| 2124 | if (!offlinecxx . . $ offline.) { |
| 2125 | bot.thread_createcxx . . $ dpp/cluster#thread_create(f98c8d4483041ac9).("thread test"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., 60, dppcxx . . $ dpp/::channel_typecxx . . $ dpp/channel_type#::CHANNEL_PUBLIC_THREADcxx . . $ dpp/CHANNEL_PUBLIC_THREAD., true, 60, [cxx . . $ std/function#function(bdc3712e480e4d04).&](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 2126 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2127 | [[maybe_unused]] const auto &thread = event.getcxx . . $ dpp/confirmation_callback_t#get(8f5363d873dd4781).<dppcxx . . $ dpp/::threadcxx . . $ dpp/thread#>(); |
| 2128 | set_testcxx . . $ set_test(c715a584a48bbbaa).(THREAD_CREATEcxx . . $ THREAD_CREATE., true); |
| 2129 | } |
| 2130 | // the thread tests are in the on_thread_create event handler |
| 2131 | }); |
| 2132 | } |
| 2133 | |
| 2134 | start_testcxx . . $ start_test(271d3161c6a64dec).(POLL_CREATEcxx . . $ POLL_CREATE.); |
| 2135 | if (!offlinecxx . . $ offline.) { |
| 2136 | dppcxx . . $ dpp/::messagecxx . . $ dpp/message# poll_msgcxx . . $ dpp/message#message(49f6e7a06ebc5aa8).{}; |
| 2137 | |
| 2138 | poll_msg.set_pollcxx . . $ dpp/message#set_poll(a8ab00de25890a9).(dppcxx . . $ dpp/::pollcxx . . $ dpp/poll#{} |
| 2139 | .set_questioncxx . . $ dpp/poll#set_question(1460f6e58e31f9f0).("hello!"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).) |
| 2140 | .add_answercxx . . $ dpp/poll#add_answer(834501e647541c25).("one"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., dppcxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).::unicode_emojicxx . . $ dpp/unicode_emoji/::onecxx . . $ dpp/unicode_emoji/one.) |
| 2141 | .add_answercxx . . $ dpp/poll#add_answer(834501e647541c25).("two"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., dppcxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).::unicode_emojicxx . . $ dpp/unicode_emoji/::twocxx . . $ dpp/unicode_emoji/two.) |
| 2142 | .add_answercxx . . $ dpp/poll#add_answer(834501e647541c25).("three"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)., dppcxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).::unicode_emojicxx . . $ dpp/unicode_emoji/::threecxx . . $ dpp/unicode_emoji/three.) |
| 2143 | .add_answercxx . . $ dpp/poll#add_answer(af1dd13d6621f8d5).("four"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).) |
| 2144 | .set_durationcxx . . $ dpp/poll#set_duration(2687ee30b32ba027).(48) |
| 2145 | .set_allow_multiselectcxx . . $ dpp/poll#set_allow_multiselect(3ea804e97ea7f20b).(true) |
| 2146 | ).set_channel_idcxx . . $ dpp/message#set_channel_id(5838913a8bdb38e4).(TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).); |
| 2147 | |
| 2148 | bot.message_createcxx . . $ dpp/cluster#message_create(1c8df330753bdf1).(poll_msg, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, poll_msgcxx . . $ dpp/message#message(55ae228098ad4d0d).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &result) { |
| 2149 | if (result.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2150 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., result.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable.); |
| 2151 | return; |
| 2152 | } |
| 2153 | |
| 2154 | const dppcxx . . $ dpp/::messagecxx . . $ dpp/message# &m = stdcxx . . $ std/::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::messagecxx . . $ dpp/message#>(result.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 2155 | |
| 2156 | if (!m.attached_pollcxx . . $ dpp/message#attached_poll..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 2157 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll missing in received message"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2158 | return; |
| 2159 | } |
| 2160 | |
| 2161 | if (m.attached_pollcxx . . $ dpp/message#attached_poll.->cxx . . $ std/optional#`operator->`(8e614c7de0b1573e).find_answercxx . . $ dpp/poll#find_answer(e55379b3df57a47e).(stdcxx . . $ std/::numeric_limitscxx . . $ std/numeric_limits#<uint32_t>::maxcxx . . $ std/numeric_limits#max(2658d6455debfaef).()) != nullptr) { |
| 2162 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll::find_answer failed to return nullptr"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2163 | return; |
| 2164 | } |
| 2165 | |
| 2166 | stdcxx . . $ std/::arraycxx . . $ std/array#<bool, 4> correct = {false, false, false, false}; |
| 2167 | int i = 0; |
| 2168 | for (const auto &[_, answer]: m.attached_pollcxx . . $ dpp/message#attached_poll.->cxx . . $ std/optional#`operator->`(8e614c7de0b1573e).answerscxx . . $ dpp/poll#answers.) { |
| 2169 | if (m.attached_pollcxx . . $ dpp/message#attached_poll.->cxx . . $ std/optional#`operator->`(8e614c7de0b1573e).find_answercxx . . $ dpp/poll#find_answer(e55379b3df57a47e).(answer.idcxx . . $ dpp/poll_answer#id.) != &answer.mediacxx . . $ dpp/poll_answer#media.) { |
| 2170 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll::find_answer failed to return valid answer"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2171 | return; |
| 2172 | } |
| 2173 | if (answer.mediacxx . . $ dpp/poll_answer#media..textcxx . . $ dpp/poll_media#text. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "one" && answer.mediacxx . . $ dpp/poll_answer#media..emojicxx . . $ dpp/poll_media#emoji..namecxx . . $ dpp/partial_emoji#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). dppcxx . . $ dpp/::unicode_emojicxx . . $ dpp/unicode_emoji/::onecxx . . $ dpp/unicode_emoji/one.) { |
| 2174 | if (correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i]) { |
| 2175 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll answer found twice"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2176 | return; |
| 2177 | } |
| 2178 | correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i] = true; |
| 2179 | } |
| 2180 | if (answer.mediacxx . . $ dpp/poll_answer#media..textcxx . . $ dpp/poll_media#text. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "two" && answer.mediacxx . . $ dpp/poll_answer#media..emojicxx . . $ dpp/poll_media#emoji..namecxx . . $ dpp/partial_emoji#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). dppcxx . . $ dpp/::unicode_emojicxx . . $ dpp/unicode_emoji/::twocxx . . $ dpp/unicode_emoji/two.) { |
| 2181 | if (correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i]) { |
| 2182 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll answer found twice"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2183 | return; |
| 2184 | } |
| 2185 | correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i] = true; |
| 2186 | } |
| 2187 | if (answer.mediacxx . . $ dpp/poll_answer#media..textcxx . . $ dpp/poll_media#text. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "three" && answer.mediacxx . . $ dpp/poll_answer#media..emojicxx . . $ dpp/poll_media#emoji..namecxx . . $ dpp/partial_emoji#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). dppcxx . . $ dpp/::unicode_emojicxx . . $ dpp/unicode_emoji/::threecxx . . $ dpp/unicode_emoji/three.) { |
| 2188 | if (correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i]) { |
| 2189 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll answer found twice"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2190 | return; |
| 2191 | } |
| 2192 | correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i] = true; |
| 2193 | } |
| 2194 | if (answer.mediacxx . . $ dpp/poll_answer#media..textcxx . . $ dpp/poll_media#text. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "four" && answer.mediacxx . . $ dpp/poll_answer#media..emojicxx . . $ dpp/poll_media#emoji..namecxx . . $ dpp/partial_emoji#name..emptycxx . . $ std/__cxx11/basic_string#empty(3482b152b9333168).()) { |
| 2195 | if (correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i]) { |
| 2196 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll answer found twice"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2197 | return; |
| 2198 | } |
| 2199 | correct[cxx . . $ std/array#`operator[]`(b18cc97d22f46aed).i] = true; |
| 2200 | bot.poll_get_answer_voterscxx . . $ dpp/cluster#poll_get_answer_voters(a24008d24a0df021).(m, answer.idcxx . . $ dpp/poll_answer#id., 0cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., 100, [cxx . . $ std/function#function(bdc3712e480e4d04).mcxx . . $ dpp/message#message(55ae228098ad4d0d)., &bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &result) { |
| 2201 | if (result.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2202 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "poll_get_answer_voters: " +cxx . . $ std/operator+(39ed2c165380f78e). result.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable.); |
| 2203 | return; |
| 2204 | } |
| 2205 | |
| 2206 | start_testcxx . . $ start_test(271d3161c6a64dec).(POLL_ENDcxx . . $ POLL_END.); |
| 2207 | bot.poll_endcxx . . $ dpp/cluster#poll_end(1c8df330753bdf1).(m, [cxx . . $ std/function#function(bdc3712e480e4d04).message_id = mcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id., channel_id = mcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..channel_idcxx . . $ dpp/message#channel_id., &bot](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &result) { |
| 2208 | if (result.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2209 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_ENDcxx . . $ POLL_END., ts_failedcxx . . $ ts_failed., result.get_errorcxx . . $ dpp/confirmation_callback_t#get_error(1c68b8ab273006ab).().human_readablecxx . . $ dpp/error_info#human_readable.); |
| 2210 | return; |
| 2211 | } |
| 2212 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_ENDcxx . . $ POLL_END., ts_successcxx . . $ ts_success.); |
| 2213 | bot.message_deletecxx . . $ dpp/cluster#message_delete(8674faafcd829b3c).(message_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., channel_idcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).); |
| 2214 | }); |
| 2215 | }); |
| 2216 | } |
| 2217 | ++i; |
| 2218 | } |
| 2219 | if (correct ==cxx . . $ std/`operator==`(a474572a1f22b964). stdcxx . . $ std/::arraycxx . . $ std/array#<bool, 4>{true, true, true, true}) { |
| 2220 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_successcxx . . $ ts_success.); |
| 2221 | } else { |
| 2222 | set_statuscxx . . $ set_status(69213411294ab03e).(POLL_CREATEcxx . . $ POLL_CREATE., ts_failedcxx . . $ ts_failed., "failed to find the submitted answers"cxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792).); |
| 2223 | } |
| 2224 | }); |
| 2225 | } |
| 2226 | |
| 2227 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MEMBER_GETcxx . . $ MEMBER_GET., false); |
| 2228 | if (!offlinecxx . . $ offline.) { |
| 2229 | bot.guild_get_membercxx . . $ dpp/cluster#guild_get_member(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const dppcxx . . $ dpp/::confirmation_callback_tcxx . . $ dpp/confirmation_callback_t# &event) { |
| 2230 | if (!event.is_errorcxx . . $ dpp/confirmation_callback_t#is_error(50ce9a9e25b4a850).()) { |
| 2231 | dppcxx . . $ dpp/::guild_membercxx . . $ dpp/guild_member# m = stdcxx . . $ std/::getcxx . . $ std/get(ca5bafa5a3bcea9d).<dppcxx . . $ dpp/::guild_membercxx . . $ dpp/guild_member#>(event.valuecxx . . $ dpp/confirmation_callback_t#value.); |
| 2232 | if (m.guild_idcxx . . $ dpp/guild_member#guild_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_GUILD_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a). && m.user_idcxx . . $ dpp/guild_member#user_id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).) { |
| 2233 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MEMBER_GETcxx . . $ MEMBER_GET., true); |
| 2234 | } else { |
| 2235 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MEMBER_GETcxx . . $ MEMBER_GET., false); |
| 2236 | } |
| 2237 | } else { |
| 2238 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MEMBER_GETcxx . . $ MEMBER_GET., false); |
| 2239 | } |
| 2240 | }); |
| 2241 | } |
| 2242 | |
| 2243 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_CREATEcxx . . $ ROLE_CREATE., false); |
| 2244 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_EDITcxx . . $ ROLE_EDIT., false); |
| 2245 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_DELETEcxx . . $ ROLE_DELETE., false); |
| 2246 | if (!offlinecxx . . $ offline.) { |
| 2247 | dppcxx . . $ dpp/::rolecxx . . $ dpp/role# rcxx . . $ dpp/role#role(49f6e7a06ebc5aa8).; |
| 2248 | r.guild_idcxx . . $ dpp/role#guild_id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). TEST_GUILD_IDcxx . . $ TEST_GUILD_ID.; |
| 2249 | r.namecxx . . $ dpp/role#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "Test-Role"; |
| 2250 | r.permissionscxx . . $ dpp/role#permissions..addcxx . . $ dpp/permission#add(8250ce5853a47440).(dppcxx . . $ dpp/::p_move_memberscxx . . $ dpp/p_move_members.); |
| 2251 | r.set_flagscxx . . $ dpp/role#set_flags(facdd955ce7d7b88).(dppcxx . . $ dpp/::r_mentionablecxx . . $ dpp/r_mentionable.); |
| 2252 | r.colourcxx . . $ dpp/role#colour. = dppcxx . . $ dpp/::colorscxx . . $ dpp/colors/::moon_yellowcxx . . $ dpp/colors/moon_yellow.; |
| 2253 | bot.role_createcxx . . $ dpp/cluster#role_create(42b39a2eece5c814).(r, [cxx . . $ std/function#function(bdc3712e480e4d04).&bot, rcxx . . $ dpp/role#role(5026c7621405fbdc).](const auto cc) { |
| 2254 | if (cc.is_error()) { |
| 2255 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_CREATEcxx . . $ ROLE_CREATE., false); |
| 2256 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_EDITcxx . . $ ROLE_EDIT., false); |
| 2257 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_DELETEcxx . . $ ROLE_DELETE., false); |
| 2258 | return; |
| 2259 | } |
| 2260 | dppcxx . . $ dpp/::rolecxx . . $ dpp/role# createdRole = stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::rolecxx . . $ dpp/role#>(cc.value); |
| 2261 | createdRole.guild_idcxx . . $ dpp/role#guild_id. =cxx . . $ dpp/snowflake#`operator=`(672d8e94f4ed0334). TEST_GUILD_IDcxx . . $ TEST_GUILD_ID.; |
| 2262 | if (createdRole.namecxx . . $ dpp/role#name. ==cxx . . $ std/`operator==`(5ea818b58063a774). r.namecxx . . $ dpp/role#name. && |
| 2263 | createdRole.has_move_memberscxx . . $ dpp/role#has_move_members(50ce9a9e25b4a850).() && |
| 2264 | createdRole.flagscxx . . $ dpp/role#flags. & dppcxx . . $ dpp/::r_mentionablecxx . . $ dpp/r_mentionable. && |
| 2265 | createdRole.colourcxx . . $ dpp/role#colour. == r.colourcxx . . $ dpp/role#colour.) { |
| 2266 | createdRole.namecxx . . $ dpp/role#name. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "Test-Role-Edited"; |
| 2267 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_CREATEcxx . . $ ROLE_CREATE., true); |
| 2268 | bot.role_editcxx . . $ dpp/cluster#role_edit(42b39a2eece5c814).(createdRole, [&bot, createdRolecxx . . $ dpp/role#role(5026c7621405fbdc).](const auto &e) { |
| 2269 | if (e.is_error()) { |
| 2270 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_EDITcxx . . $ ROLE_EDIT., false); |
| 2271 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_DELETEcxx . . $ ROLE_DELETE., false); |
| 2272 | return; |
| 2273 | } |
| 2274 | dppcxx . . $ dpp/::rolecxx . . $ dpp/role# edited = stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::rolecxx . . $ dpp/role#>(e.value); |
| 2275 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_EDITcxx . . $ ROLE_EDIT., (createdRole.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). editedcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)..idcxx . . $ dpp/managed#id. && edited.namecxx . . $ dpp/role#name. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "Test-Role-Edited")); |
| 2276 | bot.role_deletecxx . . $ dpp/cluster#role_delete(8674faafcd829b3c).(TEST_GUILD_IDcxx . . $ TEST_GUILD_ID., createdRole.idcxx . . $ dpp/managed#id., [](const auto &e) { |
| 2277 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_DELETEcxx . . $ ROLE_DELETE., !e.is_error()); |
| 2278 | }); |
| 2279 | }); |
| 2280 | } else { |
| 2281 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_CREATEcxx . . $ ROLE_CREATE., false); |
| 2282 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_EDITcxx . . $ ROLE_EDIT., false); |
| 2283 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ROLE_DELETEcxx . . $ ROLE_DELETE., false); |
| 2284 | } |
| 2285 | }); |
| 2286 | } |
| 2287 | }; |
| 2288 | |
| 2289 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BOTSTARTcxx . . $ BOTSTART., false); |
| 2290 | try { |
| 2291 | if (!offlinecxx . . $ offline.) { |
| 2292 | bot.startcxx . . $ dpp/cluster#start(fa7c3f1aeb8ff3e5).(dppcxx . . $ dpp/::st_returncxx . . $ dpp/st_return.); |
| 2293 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BOTSTARTcxx . . $ BOTSTART., true); |
| 2294 | } |
| 2295 | } |
| 2296 | catch (const stdcxx . . $ std/::exception &) { |
| 2297 | set_testcxx . . $ set_test(c715a584a48bbbaa).(BOTSTARTcxx . . $ BOTSTART., false); |
| 2298 | } |
| 2299 | |
| 2300 | dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client# *c{}; |
| 2301 | dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client# *c2{}; |
| 2302 | dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client# *c3{}; |
| 2303 | |
| 2304 | set_testcxx . . $ set_test(c715a584a48bbbaa).(HTTPScxx . . $ HTTPS., false); |
| 2305 | if (!offlinecxx . . $ offline.) { |
| 2306 | dppcxx . . $ dpp/::multipart_contentcxx . . $ dpp/multipart_content# multipart = dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#::build_multipartcxx . . $ dpp/https_client#build_multipart(655d8ac7f5ef397a).( |
| 2307 | "{\"content\":\"test\"}"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., {cxx . . $ std/vector#vector(9619226211e5a241)."test.txt", "blob.blob"}, {cxx . . $ std/vector#vector(9619226211e5a241)."ABCDEFGHI", "BLOB!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"}, {cxx . . $ std/vector#vector(9619226211e5a241)."text/plain", "application/octet-stream"} |
| 2308 | ); |
| 2309 | try { |
| 2310 | c = new dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#(&bot, "discord.com"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., 443, "/api/channels/" +cxx . . $ std/operator+(39ed2c165380f78e). stdcxx . . $ std/::to_stringcxx . . $ std/__cxx11/to_string(354ce04007c9ea85).(TEST_TEXT_CHANNEL_IDcxx . . $ TEST_TEXT_CHANNEL_ID.) +cxx . . $ std/operator+(900ec9581c410ad9). "/messages", "POST"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., multipart.bodycxx . . $ dpp/multipart_content#body., |
| 2311 | {cxx . . $ std/multimap#multimap(7786ef3e167e36fa). |
| 2312 | {"Content-Type", multipart.mimetypecxx . . $ dpp/multipart_content#mimetype.}, |
| 2313 | {"Authorization", "Bot " +cxx . . $ std/operator+(42c652dfebe55ad7). token} |
| 2314 | }, false, 5, "1.1"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., [cxx . . $ std/function#function(bdc3712e480e4d04).](dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client# *c) { |
| 2315 | stdcxx . . $ std/::stringcxx . . $ std/string# hdr1 = c->get_headercxx . . $ dpp/https_client#get_header(6e90f043f4705317).("server"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 2316 | stdcxx . . $ std/::stringcxx . . $ std/string# content1 = c->get_contentcxx . . $ dpp/https_client#get_content(fcf7e9886c190261).(); |
| 2317 | set_testcxx . . $ set_test(c715a584a48bbbaa).(HTTPScxx . . $ HTTPS., hdr1 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "cloudflare" && c->get_statuscxx . . $ dpp/https_client#get_status(72085aa11f4b6e09).() == 200); |
| 2318 | } |
| 2319 | ); |
| 2320 | } |
| 2321 | catch (const dppcxx . . $ dpp/::exceptioncxx . . $ dpp/exception# &e) { |
| 2322 | set_statuscxx . . $ set_status(69213411294ab03e).(HTTPScxx . . $ HTTPS., ts_failedcxx . . $ ts_failed., ecxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)..whatcxx . . $ dpp/exception#what(ba32b354807b2b81).()); |
| 2323 | } |
| 2324 | |
| 2325 | set_testcxx . . $ set_test(c715a584a48bbbaa).(HTTPcxx . . $ HTTP., false); |
| 2326 | try { |
| 2327 | c2 = new dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#(&bot, "github.com"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., 80, "/"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "GET"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., {cxx . . $ std/multimap#multimap(49f6e7a06ebc5aa8).}, true, 5, "1.1"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., [cxx . . $ std/function#function(bdc3712e480e4d04).](dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client# *c2) { |
| 2328 | stdcxx . . $ std/::stringcxx . . $ std/string# hdr2 = c2->get_headercxx . . $ dpp/https_client#get_header(6e90f043f4705317).("location"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 2329 | stdcxx . . $ std/::stringcxx . . $ std/string# content2 = c2->get_contentcxx . . $ dpp/https_client#get_content(fcf7e9886c190261).(); |
| 2330 | set_testcxx . . $ set_test(c715a584a48bbbaa).(HTTPcxx . . $ HTTP., hdr2 ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "https://github.com/" && c2->get_statuscxx . . $ dpp/https_client#get_status(72085aa11f4b6e09).() == 301); |
| 2331 | }); |
| 2332 | } |
| 2333 | catch (const dppcxx . . $ dpp/::exceptioncxx . . $ dpp/exception# &e) { |
| 2334 | set_statuscxx . . $ set_status(69213411294ab03e).(HTTPcxx . . $ HTTP., ts_failedcxx . . $ ts_failed., ecxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)..whatcxx . . $ dpp/exception#what(ba32b354807b2b81).()); |
| 2335 | } |
| 2336 | |
| 2337 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MULTIHEADERcxx . . $ MULTIHEADER., false); |
| 2338 | try { |
| 2339 | c3 = new dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client#(&bot, "dl.dpp.dev"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., 443, "/cookietest.php"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., "GET"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., ""cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., {cxx . . $ std/multimap#multimap(49f6e7a06ebc5aa8).}, true, 5, "1.1"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., [cxx . . $ std/function#function(bdc3712e480e4d04).](dppcxx . . $ dpp/::https_clientcxx . . $ dpp/https_client# *c2) { |
| 2340 | size_t count = c2->get_header_countcxx . . $ dpp/https_client#get_header_count(a4d6a2e8b8a60757).("set-cookie"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 2341 | size_t count_list = c2->get_header_listcxx . . $ dpp/https_client#get_header_list(eb9bd86db116d125).("set-cookie"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).).sizecxx . . $ std/__cxx11/list#size(c9b1e749b64d5edc).(); |
| 2342 | // This test script sets a bunch of cookies when we request it. |
| 2343 | set_testcxx . . $ set_test(c715a584a48bbbaa).(MULTIHEADERcxx . . $ MULTIHEADER., c2->get_statuscxx . . $ dpp/https_client#get_status(72085aa11f4b6e09).() == 200 && count > 1 && count == count_list); |
| 2344 | }); |
| 2345 | } |
| 2346 | catch (const dppcxx . . $ dpp/::exceptioncxx . . $ dpp/exception# &e) { |
| 2347 | set_statuscxx . . $ set_status(69213411294ab03e).(MULTIHEADERcxx . . $ MULTIHEADER., ts_failedcxx . . $ ts_failed., ecxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)..whatcxx . . $ dpp/exception#what(ba32b354807b2b81).()); |
| 2348 | } |
| 2349 | } |
| 2350 | |
| 2351 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMERSTARTcxx . . $ TIMERSTART., false); |
| 2352 | dppcxx . . $ dpp/::timercxx . . $ dpp/timer# th = bot.start_timercxx . . $ dpp/cluster#start_timer(9b5287c873d344e0).([cxx . . $ std/function#function(bdc3712e480e4d04).ticks = 0](dppcxx . . $ dpp/::timercxx . . $ dpp/timer# timer_handle) mutable { |
| 2353 | if (ticks == 2) { |
| 2354 | /* The simple test timer ticks every second. |
| 2355 | * If we get to 2 seconds, we know the timer is working. |
| 2356 | */ |
| 2357 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMERSTARTcxx . . $ TIMERSTART., true); |
| 2358 | } |
| 2359 | ticks++; |
| 2360 | }, 1); |
| 2361 | |
| 2362 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_PRESENTcxx . . $ USER_GET_CACHED_PRESENT., false); |
| 2363 | try { |
| 2364 | bot.user_get_cachedcxx . . $ dpp/cluster#user_get_cached(f0cdb3822bb61a0b).(TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const auto &e) { |
| 2365 | if (e.is_error()) { |
| 2366 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_PRESENTcxx . . $ USER_GET_CACHED_PRESENT., false); |
| 2367 | return; |
| 2368 | } |
| 2369 | dppcxx . . $ dpp/::user_identifiedcxx . . $ dpp/user_identified# u = stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::user_identifiedcxx . . $ dpp/user_identified#>(e.value); |
| 2370 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_PRESENTcxx . . $ USER_GET_CACHED_PRESENT., (u.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).)); |
| 2371 | }); |
| 2372 | } |
| 2373 | catch (const stdcxx . . $ std/::exception &) { |
| 2374 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_PRESENTcxx . . $ USER_GET_CACHED_PRESENT., false); |
| 2375 | } |
| 2376 | |
| 2377 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_ABSENTcxx . . $ USER_GET_CACHED_ABSENT., false); |
| 2378 | try { |
| 2379 | /* This is the snowflake ID of a discord staff member. |
| 2380 | * We assume here that staffer's discord IDs will remain constant |
| 2381 | * for long periods of time and they won't lurk in the unit test server. |
| 2382 | * If this becomes not true any more, we'll pick another well known |
| 2383 | * user ID. |
| 2384 | */ |
| 2385 | bot.user_get_cachedcxx . . $ dpp/cluster#user_get_cached(f0cdb3822bb61a0b).(90339695967350784cxx . . $ dpp/snowflake#snowflake(45405682577da2e6)., [cxx . . $ std/function#function(bdc3712e480e4d04).](const auto &e) { |
| 2386 | if (e.is_error()) { |
| 2387 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_ABSENTcxx . . $ USER_GET_CACHED_ABSENT., false); |
| 2388 | return; |
| 2389 | } |
| 2390 | dppcxx . . $ dpp/::user_identifiedcxx . . $ dpp/user_identified# u = stdcxx . . $ std/::getcxx . . $ std/get(5aabc72a970aa7ce).<dppcxx . . $ dpp/::user_identifiedcxx . . $ dpp/user_identified#>(e.value); |
| 2391 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_ABSENTcxx . . $ USER_GET_CACHED_ABSENT., (u.idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b276817fac6c20d5). 90339695967350784)); |
| 2392 | }); |
| 2393 | } |
| 2394 | catch (const stdcxx . . $ std/::exception &) { |
| 2395 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USER_GET_CACHED_ABSENTcxx . . $ USER_GET_CACHED_ABSENT., false); |
| 2396 | } |
| 2397 | |
| 2398 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMEDLISTENERcxx . . $ TIMEDLISTENER., false); |
| 2399 | dppcxx . . $ dpp/::timed_listener tlcxx . . $ dpp/timed_listener#timed_listener(24c14793e2d720b2).(&bot, 10, bot.on_logcxx . . $ dpp/cluster#on_log., [&](const dppcxx . . $ dpp/::log_tcxx . . $ dpp/log_t# &event) { |
| 2400 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMEDLISTENERcxx . . $ TIMEDLISTENER., true); |
| 2401 | }); |
| 2402 | |
| 2403 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ONESHOTcxx . . $ ONESHOT., false); |
| 2404 | bool once = false; |
| 2405 | dppcxx . . $ dpp/::oneshot_timercxx . . $ dpp/oneshot_timer# ostcxx . . $ dpp/oneshot_timer#oneshot_timer(6c898eae69be25f4).(&bot, 5, [cxx . . $ std/function#function(bdc3712e480e4d04).&](dppcxx . . $ dpp/::timercxx . . $ dpp/timer# timer_handle) { |
| 2406 | if (!once) { |
| 2407 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ONESHOTcxx . . $ ONESHOT., true); |
| 2408 | } else { |
| 2409 | set_testcxx . . $ set_test(c715a584a48bbbaa).(ONESHOTcxx . . $ ONESHOT., false); |
| 2410 | } |
| 2411 | once = true; |
| 2412 | }); |
| 2413 | |
| 2414 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CUSTOMCACHEcxx . . $ CUSTOMCACHE., false); |
| 2415 | dppcxx . . $ dpp/::cachecxx . . $ dpp/cache#<test_cached_object_tcxx . . $ test_cached_object_t#> testcachecxx . . $ dpp/cache#cache(49f6e7a06ebc5aa8).; |
| 2416 | test_cached_object_tcxx . . $ test_cached_object_t# *tco = new test_cached_object_tcxx . . $ test_cached_object_t#(666cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 2417 | tco->foocxx . . $ test_cached_object_t#foo. =cxx . . $ std/__cxx11/basic_string#`operator=`(978ca1133b5f6e74). "bar"; |
| 2418 | testcache.storecxx . . $ dpp/cache#store(ebd0a1552f8ce24f).(tco); |
| 2419 | test_cached_object_tcxx . . $ test_cached_object_t# *found_tco = testcache.findcxx . . $ dpp/cache#find(803cca1d967888af).(666cxx . . $ dpp/snowflake#snowflake(45405682577da2e6).); |
| 2420 | if (found_tco && found_tco->idcxx . . $ dpp/managed#id. ==cxx . . $ dpp/snowflake#`operator==`(b7f99ffc707c9db7). dppcxx . . $ dpp/::snowflakecxx . . $ dpp/snowflake#(666) && found_tco->foocxx . . $ test_cached_object_t#foo. ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). "bar") { |
| 2421 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CUSTOMCACHEcxx . . $ CUSTOMCACHE., true); |
| 2422 | } else { |
| 2423 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CUSTOMCACHEcxx . . $ CUSTOMCACHE., false); |
| 2424 | } |
| 2425 | testcache.removecxx . . $ dpp/cache#remove(ebd0a1552f8ce24f).(found_tco); |
| 2426 | |
| 2427 | if (!offlinecxx . . $ offline.) { |
| 2428 | if (stdcxx . . $ std/::future_statuscxx . . $ std/future_status# status = ready_future.wait_forcxx . . $ std/__basic_future#wait_for(2aaa56b9d91bb71b).(stdcxx . . $ std/::chronocxx . . $ std/chrono/::secondscxx . . $ std/chrono/seconds#(20)); status != stdcxx . . $ std/::future_statuscxx . . $ std/future_status#::timeoutcxx . . $ std/future_status#timeout.) { |
| 2429 | do_online_tests(cxx . . $ main(afcd3168fc1188a4).$anonymous_type_3#`operator()`(83f5f38750778ac8).); |
| 2430 | } |
| 2431 | } |
| 2432 | |
| 2433 | noparam_api_testcxx . . $ `src/unittest/test.h:419:9`!(current_user_get, dpp::user_identified, CURRENTUSER); |
| 2434 | singleparam_api_testcxx . . $ `src/unittest/test.h:308:9`!(channel_get, TEST_TEXT_CHANNEL_ID, dpp::channel, GETCHAN); |
| 2435 | singleparam_api_testcxx . . $ `src/unittest/test.h:308:9`!(guild_get, TEST_GUILD_ID, dpp::guild, GETGUILD); |
| 2436 | singleparam_api_test_listcxx . . $ `src/unittest/test.h:352:9`!(roles_get, TEST_GUILD_ID, dpp::role_map, GETROLES); |
| 2437 | singleparam_api_test_listcxx . . $ `src/unittest/test.h:352:9`!(channels_get, TEST_GUILD_ID, dpp::channel_map, GETCHANS); |
| 2438 | singleparam_api_test_listcxx . . $ `src/unittest/test.h:352:9`!(guild_get_invites, TEST_GUILD_ID, dpp::invite_map, GETGUILDINVS); |
| 2439 | multiparam_api_test_listcxx . . $ `src/unittest/test.h:374:9`!(guild_get_bans, TEST_GUILD_ID, dpp::ban_map, GETBANS); |
| 2440 | singleparam_api_test_listcxx . . $ `src/unittest/test.h:352:9`!(channel_pins_get, TEST_TEXT_CHANNEL_ID, dpp::message_pin_map, GETPINS); |
| 2441 | singleparam_api_test_listcxx . . $ `src/unittest/test.h:352:9`!(guild_events_get, TEST_GUILD_ID, dpp::scheduled_event_map, GETEVENTS); |
| 2442 | twoparam_api_testcxx . . $ `src/unittest/test.h:330:9`!(guild_event_get, TEST_GUILD_ID, TEST_EVENT_ID, dpp::scheduled_event, GETEVENT); |
| 2443 | twoparam_api_test_listcxx . . $ `src/unittest/test.h:396:9`!(guild_event_users_get, TEST_GUILD_ID, TEST_EVENT_ID, dpp::event_member_map, GETEVENTUSERS); |
| 2444 | |
| 2445 | stdcxx . . $ std/::this_threadcxx . . $ std/this_thread/::sleep_forcxx . . $ std/this_thread/sleep_for(fb2140da9187dddf).(stdcxx . . $ std/::chronocxx . . $ std/chrono/::secondscxx . . $ std/chrono/seconds#(20)); |
| 2446 | |
| 2447 | /* Test stopping timer */ |
| 2448 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMERSTOPcxx . . $ TIMERSTOP., false); |
| 2449 | set_testcxx . . $ set_test(c715a584a48bbbaa).(TIMERSTOPcxx . . $ TIMERSTOP., bot.stop_timercxx . . $ dpp/cluster#stop_timer(31596a199e1d8a50).(th)); |
| 2450 | |
| 2451 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USERCACHEcxx . . $ USERCACHE., false); |
| 2452 | if (!offlinecxx . . $ offline.) { |
| 2453 | dppcxx . . $ dpp/::usercxx . . $ dpp/user# *u = dppcxx . . $ dpp/::find_usercxx . . $ dpp/find_user(97f6f482dd4099d3).(TEST_USER_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).); |
| 2454 | set_testcxx . . $ set_test(c715a584a48bbbaa).(USERCACHEcxx . . $ USERCACHE., u); |
| 2455 | } |
| 2456 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNELCACHEcxx . . $ CHANNELCACHE., false); |
| 2457 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNELTYPEScxx . . $ CHANNELTYPES., false); |
| 2458 | if (!offlinecxx . . $ offline.) { |
| 2459 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# *c = dppcxx . . $ dpp/::find_channelcxx . . $ dpp/find_channel(a7f51a27f53cb107).(TEST_TEXT_CHANNEL_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).); |
| 2460 | dppcxx . . $ dpp/::channelcxx . . $ dpp/channel# *c2 = dppcxx . . $ dpp/::find_channelcxx . . $ dpp/find_channel(a7f51a27f53cb107).(TEST_VC_IDcxx . . $ dpp/snowflake#snowflake(14a7ecd272f4e02a).); |
| 2461 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNELCACHEcxx . . $ CHANNELCACHE., c && c2); |
| 2462 | set_testcxx . . $ set_test(c715a584a48bbbaa).(CHANNELTYPEScxx . . $ CHANNELTYPES., c && c->is_text_channelcxx . . $ dpp/channel#is_text_channel(50ce9a9e25b4a850).() && !c->is_voice_channelcxx . . $ dpp/channel#is_voice_channel(50ce9a9e25b4a850).() && c2 && c2->is_voice_channelcxx . . $ dpp/channel#is_voice_channel(50ce9a9e25b4a850).() && !c2->is_text_channelcxx . . $ dpp/channel#is_text_channel(50ce9a9e25b4a850).()); |
| 2463 | } |
| 2464 | |
| 2465 | wait_for_testscxx . . $ wait_for_tests(49f6e7a06ebc5aa8).(); |
| 2466 | |
| 2467 | delete c; |
| 2468 | delete c2; |
| 2469 | delete c3; |
| 2470 | |
| 2471 | } |
| 2472 | catch (const stdcxx . . $ std/::exception &e) { |
| 2473 | set_statuscxx . . $ set_status(69213411294ab03e).(CLUSTERcxx . . $ CLUSTER., ts_failedcxx . . $ ts_failed., ecxx . . $ std/basic_string_view#basic_string_view(837a1ee5a10cb792)..what()); |
| 2474 | } |
| 2475 | |
| 2476 | /* Return value = number of failed tests, exit code 0 = success */ |
| 2477 | return test_summarycxx . . $ test_summary(b126dc7c1de90089).(); |
| 2478 | |
| 2479 | } |
| 2480 | catch (const stdcxx . . $ std/::exception& e) { |
| 2481 | stdcxx . . $ std/::cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Unhandled std::exception thrown: " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). stdcxx . . $ std/::stringcxx . . $ std/string#(e.what()) <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\n"; |
| 2482 | exit(99); |
| 2483 | } |
| 2484 | catch (const stdcxx . . $ std/::stringcxx . . $ std/string#& e) { |
| 2485 | /* This is a safety net, none of our stuff throws strings! */ |
| 2486 | stdcxx . . $ std/::cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Unhandled std::string thrown: " <<cxx . . $ std/`operator<<`(88df5bef833f7f83). e <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "\n"; |
| 2487 | exit(99); |
| 2488 | } |
| 2489 | catch (...) { |
| 2490 | stdcxx . . $ std/::cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "Unhandled '...' thrown\n"; |
| 2491 | exit(99); |
| 2492 | } |
| 2493 | } |