Random undefined cards popping up ingame #2

Closed
opened 2024-02-16 23:20:27 -06:00 by JMTNTBANG · 1 comment
JMTNTBANG commented 2024-02-16 23:20:27 -06:00 (Migrated from github.com)

its adding undefined to the hand at random times, which causes the bot to crash

Exception:

/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:6
  if (card.type == "number" && card.color != "wild") {
           ^

TypeError: Cannot read properties of undefined (reading 'type')
    at print_card (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:6:12)
    at /home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:63:25
    at Array.forEach (<anonymous>)
    at /home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:62:19
    at Array.forEach (<anonymous>)
    at show_hands (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:60:6)
    at sent_thread_cmd (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:202:9)
    at MessageCollector.<anonymous> (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:256:31)
    at MessageCollector.emit (node:events:519:28)
    at MessageCollector.handleCollect (/home/ubuntu/Bots/The-Card-Game-Bot/node_modules/discord.js/src/structures/interfaces/Collector.js:133:14)

User Feed:
image

Channel URL:
https://discord.com/channels/1074900282133184542/1208278151843545098

its adding `undefined` to the hand at random times, which causes the bot to crash Exception: ```js /home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:6 if (card.type == "number" && card.color != "wild") { ^ TypeError: Cannot read properties of undefined (reading 'type') at print_card (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:6:12) at /home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:63:25 at Array.forEach (<anonymous>) at /home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:62:19 at Array.forEach (<anonymous>) at show_hands (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:60:6) at sent_thread_cmd (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:202:9) at MessageCollector.<anonymous> (/home/ubuntu/Bots/The-Card-Game-Bot/src/games/uno.js:256:31) at MessageCollector.emit (node:events:519:28) at MessageCollector.handleCollect (/home/ubuntu/Bots/The-Card-Game-Bot/node_modules/discord.js/src/structures/interfaces/Collector.js:133:14) ``` User Feed: ![image](https://github.com/JMTNTBANG/The-Card-Game-Bot/assets/32822936/aacf4027-2109-40b1-b9ab-f0fb3a644135) Channel URL: https://discord.com/channels/1074900282133184542/1208278151843545098
JMTNTBANG commented 2024-02-17 00:26:18 -06:00 (Migrated from github.com)

So this wasnt just a deck rollover issue, its still happening

So this wasnt just a deck rollover issue, its still happening
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JMTNTBANG/The-Card-Game-Bot#2
No description provided.