krisppurg / dimscord

A Discord Bot & REST Library for Nim.
https://krisppurg.github.io/dimscord/
MIT License
222 stars 22 forks source link

W.I.P.: Add v9 support + threads #58

Closed dannyhpy closed 2 years ago

dannyhpy commented 2 years ago

This is a draft. There is a lot of things I'm unsure about at the moment.

Threads are only available in v9 ; using -d:dimscordv9 is necessary in order to use them.

var discord: DiscordClient
var channel: GuildChannel

# ...

## Creates a thread
var threadChannel = await discord.api.startThread(channel.id, "test")
## Deletes it
await discord.api.deleteChannel(threadChannel.id)

There are a lot of properties in GuildChannel that are marked as optionnal in the Discord docs even though they're mandatory in the library (for instance, rate_limit_per_user). What about making them optional?

krisppurg commented 2 years ago

For the GuildChannel issue, don't worry I will take care of the fields and modify your changes. Right now I have a bunch of files unsaved (because the implementation is uncomplete.) and hopefully I will get to save those files, test them and finally push them to master.

Thanks for the effort though, really appreciated.

krisppurg commented 2 years ago

Also, if you are worried about testing threads, I will either do it.