Skip to content

Commit a1d380f

Browse files
committed
fix: unit test now expects correct value for pins
1 parent 1b26ed3 commit a1d380f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/dpp/cluster.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ class DPP_EXPORT cluster {
23752375
* @see https://discord.com/developers/docs/resources/channel#get-pinned-messages
23762376
* @param channel_id Channel ID to get pins for
23772377
* @param callback Function to call when the API call completes.
2378-
* On success the callback will contain a dpp::message_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
2378+
* On success the callback will contain a dpp::message_pin_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
23792379
*/
23802380
void channel_pins_get(snowflake channel_id, command_completion_event_t callback);
23812381

@@ -2386,7 +2386,7 @@ class DPP_EXPORT cluster {
23862386
* @param before Get messages pinned before this timestamp.
23872387
* @param limit Max number of pins to return (1-50). Defaults to 50 if not set.
23882388
* @param callback Function to call when the API call completes.
2389-
* On success the callback will contain a dpp::message_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
2389+
* On success the callback will contain a dpp::message_pin_map object in confirmation_callback_t::value. On failure, the value is undefined and confirmation_callback_t::is_error() method will return true. You can obtain full error details with confirmation_callback_t::get_error().
23902390
*/
23912391
void channel_pins_get(snowflake channel_id, std::optional<time_t> before, std::optional<uint64_t> limit, command_completion_event_t callback);
23922392

src/dpp/cluster/message.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ void cluster::channel_pins_get(snowflake channel_id, command_completion_event_t
211211
}
212212

213213
void cluster::channel_pins_get(snowflake channel_id, std::optional<time_t> before, std::optional<uint64_t> limit, command_completion_event_t callback) {
214-
if (!limit.has_value())
215-
{
214+
if (!limit.has_value()) {
216215
limit = GET_CHANNEL_PINS_MAX;
217216
}
218217

@@ -238,6 +237,7 @@ void cluster::channel_pins_get(snowflake channel_id, std::optional<time_t> befor
238237
list[pinned_msg.pinned_message.id] = pinned_msg;
239238
}
240239
}
240+
241241
if (callback) {
242242
callback(confirmation_callback_t(this, list, http));
243243
}

src/unittest/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,7 @@ Markdown lol \\|\\|spoiler\\|\\| \\~\\~strikethrough\\~\\~ \\`small \\*code\\* b
24242424
singleparam_api_test_list(channels_get, TEST_GUILD_ID, dpp::channel_map, GETCHANS);
24252425
singleparam_api_test_list(guild_get_invites, TEST_GUILD_ID, dpp::invite_map, GETINVS);
24262426
multiparam_api_test_list(guild_get_bans, TEST_GUILD_ID, dpp::ban_map, GETBANS);
2427-
singleparam_api_test_list(channel_pins_get, TEST_TEXT_CHANNEL_ID, dpp::message_map, GETPINS);
2427+
singleparam_api_test_list(channel_pins_get, TEST_TEXT_CHANNEL_ID, dpp::message_pin_map, GETPINS);
24282428
singleparam_api_test_list(guild_events_get, TEST_GUILD_ID, dpp::scheduled_event_map, GETEVENTS);
24292429
twoparam_api_test(guild_event_get, TEST_GUILD_ID, TEST_EVENT_ID, dpp::scheduled_event, GETEVENT);
24302430
twoparam_api_test_list(guild_event_users_get, TEST_GUILD_ID, TEST_EVENT_ID, dpp::event_member_map, GETEVENTUSERS);

0 commit comments

Comments
 (0)