krisppurg / dimscord

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

Bug: Error: expression 'none seq[Channel]' has no type (or is ambiguous) #70

Closed GuyPerson7018 closed 2 years ago

GuyPerson7018 commented 2 years ago

When the example code(or any code that imports this library) is compiled with the --threads:on flag, the following error is observed: dimscord-1.3.0/dimscord/restapi/guild.nim(90, 25) Error: expression 'none seq[Channel]' has no type (or is ambiguous)

To solve this problem, I have replaced channels = none seq[Channel] (guild.nim, line 90) with channels = none seq[objects.Channel]

krisppurg commented 2 years ago

I'm guessing whenever you compile with threads on, maybe there is something named Channel? And in which causes conflicts, because there is also another Channel object causing nim to be confused.

Try renaming Channel to something like GuildCreateChannel and see if that is the case.

GuyPerson7018 commented 2 years ago

Yep, there is another object being imported called system.Channel. That's why I'm suggesting that the Channel in guild.nim be replaced with objects.Channel