URL error
Opened this issue · 6 comments
Deleted user commented
I have error on run example
earn.nim(19) learn
discord.nim(149) newShard
asyncdispatch.nim(1656) waitFor
asyncdispatch.nim(1516) poll
asyncdispatch.nim(355) runOnce
asyncdispatch.nim(191) processPendingCallbacks
asyncmacro.nim(36) getGateway_continue
json.nim(1199) getGatewayIter
json.nim(475) []
tables.nim(165) []
[[reraised from:
learn.nim(19) learn
discord.nim(149) newShard
asyncdispatch.nim(1658) waitFor
asyncfutures.nim(302) read
]]
Error: unhandled exception: key not found: url
Async traceback:
learn.nim(19) learn
discord.nim(149) newShard
asyncdispatch.nim(1656) waitFor
asyncdispatch.nim(1516) poll
## Processes asynchronous completion events
asyncdispatch.nim(355) runOnce
asyncdispatch.nim(191) processPendingCallbacks
## Executes pending callbacks
asyncmacro.nim(36) getGateway_continue
## Resumes an async procedure
json.nim(1199) getGatewayIter
json.nim(475) []
tables.nim(165) []
Exception message: key not found: url
Exception type: [KeyError]
Error: execution of an external program failed: 'C:\Users\Rayan\Desktop\workspace\learn\src\learn.exe '
stack trace: (most recent call last)
Krognol commented
Works on my end. Can you post your code?
Deleted user commented
Yes, sure !
import asyncdispatch, discordnim
proc messageCreate(s: Shard, m: MessageCreate) =
if s.cache.me.id == m.author.id: return
if m.content == "ping":
asyncCheck s.channelMessageSend(m.channel_id, "pong")
let d = newShard("Bot <Token>")
proc endSession() {.noconv.} =
waitFor d.disconnect()
setControlCHook(endSession)
d.compress = true
let removeProc = d.addHandler(EventType.message_create, messageCreate)
waitFor d.startSession()
removeProc()
Krognol commented
Did you replace <token>
with your bots token?
Deleted user commented
Yes
Deleted user commented
OK! It was a bug coming from me!
I will still do a PR tonight to detail your README for easy use of the library
If not, what can I do to help you
Krognol commented
Any help is greatly appreciated!