Structure-Discord-Bot
Structure-Discord-Bot copied to clipboard
Slash.js
Hello, this is strange to me so when i first clone the bot and use the slash it works perfectly fine but after a few time of it working it comes up with this and im not to sure why.
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at _REST.resolveRequest (D:\discord-Bots-WIP\Structure-Discord-Bot\node_modules\@discordjs\rest\dist\index.js:1393:26)
at _REST.queueRequest (D:\discord-Bots-WIP\Structure-Discord-Bot\node_modules\@discordjs\rest\dist\index.js:1312:46)
at _REST.request (D:\discord-Bots-WIP\Structure-Discord-Bot\node_modules\@discordjs\rest\dist\index.js:1278:33)
at _REST.put (D:\discord-Bots-WIP\Structure-Discord-Bot\node_modules\@discordjs\rest\dist\index.js:1261:17)
at D:\discord-Bots-WIP\Structure-Discord-Bot\slash.js:20:14
at Object.<anonymous> (D:\discord-Bots-WIP\Structure-Discord-Bot\slash.js:32:3)
at Module._compile (node:internal/modules/cjs/loader:1254:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
at Module.load (node:internal/modules/cjs/loader:1117:32)```
- Convert BigInt to String: Before sending data that might contain BigInt to JSON.stringify, convert the BigInt to a string. 2. Custom Replacer Function: Use a custom replacer function with JSON.stringify to handle BigInt values.