gizmo385 / discord.clj

A Clojure library for creating Discord bots
MIT License
45 stars 14 forks source link

Attempting to close a DiscordBot fails #2

Closed codonnell closed 6 years ago

codonnell commented 6 years ago

If I try to call the close method on an instance of discord.bot.DiscordBot, I get the error IllegalArgumentException No implementation of method: :close of protocol: #'gniazdo.core/Client found for class: clojure.lang.Atom clojure.core/-cache-protocol-fn (core_deftype.clj:583).

I believe the reason is that https://github.com/gizmo385/discord.clj/blob/master/src/discord/gateway.clj#L52 should deref the websocket atom with (ws/close @(:websocket this)). I'd be happy to submit a PR, but it seems a little silly for such a small change.

Thanks for all the work you've put into this! :+1:

gizmo385 commented 6 years ago

@codonnell I think I've fixed this issue in this commit. Also added an Admin protected shutdown command that performs the close. Let me know if you're still seeing issues :)