Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 0e38657

Browse files
author
Sharon Williams
committed
Fixed guild::create_voice_channel() REST call
1 parent b49f870 commit 0e38657

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

include/aegis/guild.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct create_text_channel_t
7474

7575
struct create_voice_channel_t
7676
{
77-
create_voice_channel_t & name(snowflake param) { _name = param; return *this; }
77+
create_voice_channel_t & name(const std::string param) { _name = param; return *this; }
7878
create_voice_channel_t & bitrate(int32_t param) { _bitrate = param; return *this; }
7979
create_voice_channel_t & user_limit(int32_t param) { _user_limit = param; return *this; }
8080
create_voice_channel_t & parent_id(int64_t param) { _parent_id = param; return *this; }

include/aegis/impl/guild.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,12 @@ AEGIS_DECL aegis::future<gateway::objects::channel> guild::create_voice_channel(
627627
json obj;
628628
obj["name"] = name;
629629
obj["type"] = 2;
630-
obj["bitrate"] = bitrate;
631-
obj["user_limit"] = user_limit;
632-
obj["parent_id"] = parent_id;
630+
if (bitrate > 0)
631+
obj["bitrate"] = bitrate;
632+
if (user_limit > 0)
633+
obj["user_limit"] = user_limit;
634+
if (parent_id > 0)
635+
obj["parent_id"] = parent_id;
633636
obj["permission_overwrites"] = json::array();
634637
for (auto & p_ow : permission_overwrites)
635638
{

0 commit comments

Comments
 (0)