sleepy-discord icon indicating copy to clipboard operation
sleepy-discord copied to clipboard

createTextChannel() doesn't work

Open Paket236 opened this issue 3 years ago • 3 comments

This function does not work. I would like to be able to create categories and text channels.

Paket236 avatar Sep 20 '20 21:09 Paket236

hmm, I plan on making making a new type template called json::Dynamic<Type> , looking at this endpoint, I think this will be a very good use case.

yourWaifu avatar Sep 21 '20 00:09 yourWaifu

To give a bit of an update, I've renamed it to json::Maybe<Type> and I've pushed it to the develop branch, https://github.com/yourWaifu/sleepy-discord/commit/327042c60d1cb6bf07ab82f85feb1450adca7531 I might make another one called json::Optional<Type> if I think it'll be useful, the main difference is that Maybe is a pointer while Optional is a union, which allows it to be on the stack but will always take up memory even when null.

yourWaifu avatar Sep 29 '20 22:09 yourWaifu

According to https://discord.com/developers/docs/resources/channel#channel-object-channel-types request(Post, path("guilds/{guild.id}/channels", { serverID }), settings, "{"name": " + json::string(name) + ", "type": "text"}") Should be: request(Post, path("guilds/{guild.id}/channels", { serverID }), settings, "{"name": " + json::string(name) + ", "type": 0}")

jpapale avatar Jan 27 '21 19:01 jpapale