krisppurg / dimscord

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

Error: Fatal error occurred (intents issue) #85

Closed JEAPI-DEV closed 1 year ago

JEAPI-DEV commented 1 year ago

I got a small problem. Got absolutely no Idea what so ever how to fix it myself.

[Lib]: Dimscord (v1.4.0) - v10 [Lib]: Starting gateway session. [Lib]: Making request to GET https://discord.com/api/v10/gateway/bot size: 0, reason: "" [Lib]: Got response. [Lib]: Awaiting for body to be parsed [Lib]: Request has finished. [Lib]: Successfully retrived gateway information from Discord: shards: 1, session_start_limit: (total: 1000, remaining: 990, reset_after: 65942203, max_concurrency: 1) shard: 0: Connecting to wss://gateway.discord.gg/?v=10 shard: 0: Socket state: -> (tcpSocket: ..., version: 0, key: "", protocol: "", readyState: Open, masked: true)

shard: 0: Sending OP: 2 shard: 0: Received 'HELLO' from the gateway. shard: 0: Sending heartbeat. shard: 0: Sending OP: 1 shard: 0: Heartbeat Acknowledged by Discord. shard: 0: An error occurred while parsing data: Disallowed intent(s). shard: 0: Socket suspended code: 4014, reason: "Disallowed intent(s)." [Lib]: Fatal error: Disallowed intent(s). shard: 0: Socket suspended code: 4014, reason: "Disallowed intent(s)." [Lib]: Fatal error: Disallowed intent(s). /home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot.nim(36) discordbot /usr/lib/nim/pure/asyncdispatch.nim(1961) waitFor /usr/lib/nim/pure/asyncdispatch.nim(1653) poll /usr/lib/nim/pure/asyncdispatch.nim(1394) runOnce /usr/lib/nim/pure/asyncdispatch.nim(234) processPendingCallbacks /usr/lib/nim/pure/asyncmacro.nim(28) startSessionNimAsyncContinue /home/jeapi/.nimble/pkgs/dimscord-1.4.0/dimscord/gateway.nim(567) startSessionIter [[reraised from: /home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot.nim(36) discordbot /usr/lib/nim/pure/asyncdispatch.nim(1961) waitFor /usr/lib/nim/pure/asyncdispatch.nim(1653) poll /usr/lib/nim/pure/asyncdispatch.nim(1394) runOnce /usr/lib/nim/pure/asyncdispatch.nim(234) processPendingCallbacks /usr/lib/nim/pure/asyncmacro.nim(28) startSessionNimAsyncContinue /usr/lib/nim/system/excpt.nim(144) startSessionIter ]] [[reraised from: /home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot.nim(36) discordbot /usr/lib/nim/pure/asyncdispatch.nim(1961) waitFor /usr/lib/nim/pure/asyncdispatch.nim(1653) poll /usr/lib/nim/pure/asyncdispatch.nim(1394) runOnce /usr/lib/nim/pure/asyncdispatch.nim(234) processPendingCallbacks /usr/lib/nim/pure/asyncmacro.nim(28) startSessionNimAsyncContinue /usr/lib/nim/pure/asyncmacro.nim(131) startSessionIter /usr/lib/nim/pure/asyncfutures.nim(389) read ]] [[reraised from: /home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot.nim(36) discordbot /usr/lib/nim/pure/asyncdispatch.nim(1963) waitFor /usr/lib/nim/pure/asyncfutures.nim(389) read ]] Error: unhandled exception: Fatal error occurred. Async traceback: /home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot.nim(36) discordbot /usr/lib/nim/pure/asyncdispatch.nim(1961) waitFor /usr/lib/nim/pure/asyncdispatch.nim(1653) poll /usr/lib/nim/pure/asyncdispatch.nim(1394) runOnce /usr/lib/nim/pure/asyncdispatch.nim(234) processPendingCallbacks /usr/lib/nim/pure/asyncmacro.nim(28) startSessionNimAsyncContinue /home/jeapi/.nimble/pkgs/dimscord-1.4.0/dimscord/gateway.nim(567) startSessionIter

[

/home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot.nim(36)     discordbot
/usr/lib/nim/pure/asyncdispatch.nim(1961)                         waitFor
/usr/lib/nim/pure/asyncdispatch.nim(1653)                         poll
/usr/lib/nim/pure/asyncdispatch.nim(1394)                         runOnce
/usr/lib/nim/pure/asyncdispatch.nim(234)                          processPendingCallbacks
/usr/lib/nim/pure/asyncmacro.nim(28)                              startSessionNimAsyncContinue
/usr/lib/nim/system/excpt.nim(144)                                startSessionIter

]#

[

/home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot.nim(36)     discordbot
/usr/lib/nim/pure/asyncdispatch.nim(1961)                         waitFor
/usr/lib/nim/pure/asyncdispatch.nim(1653)                         poll
/usr/lib/nim/pure/asyncdispatch.nim(1394)                         runOnce
/usr/lib/nim/pure/asyncdispatch.nim(234)                          processPendingCallbacks
/usr/lib/nim/pure/asyncmacro.nim(28)                              startSessionNimAsyncContinue
/usr/lib/nim/pure/asyncmacro.nim(131)                             startSessionIter
/usr/lib/nim/pure/asyncfutures.nim(389)                           read

]# Exception message: Fatal error occurred. [Exception] Error: execution of an external program failed: '/home/jeapi/Desktop/workspacecs/nim/nimBot/discordbot '

It has probably something to do with that part:

[shard: 0]: An error occurred while parsing data: Disallowed intent(s). [shard: 0]: Socket suspended code: 4014, reason: "Disallowed intent(s)." [Lib]: Fatal error: Disallowed intent(s). [shard: 0]: Socket suspended code: 4014, reason: "Disallowed intent(s)." [Lib]: Fatal error: Disallowed intent(s).

I'm new to nim, so it's probably my fault. I just copied your example code, replaced the token with my bot Token and started it. Tested the Token with a python dc bot and it worked just fine.

krisppurg commented 1 year ago

Enable message content intent in your bot, if your bot is in smth like 100 guilds then either verify then use the intent. Dimscord enables them by default if intents not specified.

JEAPI-DEV commented 1 year ago

Thanks for the reply. Everything works now.