krisppurg / dimscord

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

Segfaults on on_disconnect. #30

Closed krisppurg closed 3 years ago

krisppurg commented 3 years ago

This occurs when s.connection == nil.

ire4ever1190 commented 3 years ago

in case anyone is having the issue like me, a hacky solution until it is solved is to just use the on_disconnect event

discord.events.on_disconnect = proc (s: Shard) {.async.} =
    echo("You have been disconnected")

I'm guessing the issue is that it's calling a function that is nil?

krisppurg commented 3 years ago

Have you tried that hobble?

ire4ever1190 commented 3 years ago

Using it in doccat, hasn't crashed when it usually would after a few hours