yourWaifu / sleepy-discord

C++ library for the Discord chat client. Please use Rust for new bots

Home Page:https://yourWaifu.github.io/sleepy-discord/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

createChannel doesn't exsit, and createTextChannel gives errors on use.

AngryUshanka opened this issue · comments

createTextChannel(message.serverID, "channel"); on execution gives this error.
Error 400: The request was improperly formatted, or the server couldn't understand it Error 5005: {"type": ["Value \"text\" is not int."]}
I cannot change the type value of this function.

createChannel doesn't exist at all and gives me an error. Despite existing in the documentation

I believe this has been fixed in the develop version of the library

ObjectResponse<Channel> BaseDiscordClient::createTextChannel(Snowflake<Server> serverID, std::string name, RequestSettings<ObjectResponse<Channel>> settings) {
return ObjectResponse<Channel>{
request(Post, path("guilds/{guild.id}/channels", { serverID }), settings, "{\"name\": " + json::string(name) + ", \"type\": \"text\"}")
};
}

ObjectResponse<Channel> BaseDiscordClient::createTextChannel(Snowflake<Server> serverID, std::string name, RequestSettings<ObjectResponse<Channel>> settings) {
return ObjectResponse<Channel>{
request(Post, path("guilds/{guild.id}/channels", { serverID }), settings, "{\"name\": " + json::string(name) + ", \"type\": 0}")
};
}