Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Dead during cooldown check #159

Closed
danirod opened this issue Jul 9, 2020 · 1 comment
Closed

Dead during cooldown check #159

danirod opened this issue Jul 9, 2020 · 1 comment
Assignees
Labels
bug Something is not working

Comments

@danirod
Copy link
Member

danirod commented Jul 9, 2020

TypeError: Cannot read property 'getTime' of null
    at requiresCooldown (/clank/dist/hooks/verify.js:11:61)
    at VerifyService.handleMessage (/clank/dist/hooks/verify.js:42:13)
    at Makibot.<anonymous> (/clank/dist/hooks/verify.js:22:48)
    at Makibot.emit (events.js:327:22)
    at MessageCreateHandler.handle (/clank/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
    at WebSocketPacketManager.handle (/clank/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
    at WebSocketConnection.onPacket (/clank/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
    at WebSocketConnection.onMessage (/clank/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
    at WebSocket.onMessage (/clank/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:315:20)
@danirod danirod added the bug Something is not working label Jul 9, 2020
@danirod danirod self-assigned this Jul 9, 2020
danirod added a commit that referenced this issue Jul 19, 2020
It may be that not always Discord.js provides the joinedAt timestamp,
which causes some members to have a value of null. Not checking this
causes the server to die, as reported in #159.

This commit will add checks before using the joinedAt field. Manual
investigation in our #captchas and #modlog channels shows that usually
these people have stayed longer than 5 minutes anyway, so the commit
makes the server bypass the verification process when joinedAt is not
available and automatically treat the user as if they had passed more
than 5 minutes in the server anyway.

This behaviour could be reverted in the future if #9 gets implemented at
some point and Clank can keep a local record that does not depend on the
response from Discord.js API.

Additionally, this commit will rewrite the message that a user receives
when triggers the captcha before the verification period expires, using
gender neutral language.
@danirod
Copy link
Member Author

danirod commented Jul 19, 2020

Fixed in a931eb3

@danirod danirod closed this as completed Jul 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

1 participant