Running Bot powered by Discord.js on NodeJS ------------------------------------------- internal/modules/cjs/loader.js:990 throw err; ^
SyntaxError: C:\Users\傑\Desktop\簽到機器人\config.json: Unexpected token } in JSON at position 231 at JSON.parse () [90m at Object.Module._extensions..json (internal/modules/cjs/loader.js:987:27) [39m [90m at Module.load (internal/modules/cjs/loader.js:812:32) [39m [90m at Function.Module._load (internal/modules/cjs/loader.js:724:14) [39m [90m at Module.require (internal/modules/cjs/loader.js:849:19) [39m [90m at require (internal/modules/cjs/helpers.js:74:18) [39m at Object. (C:\Users\傑\Desktop\簽到機器人\bot.js:1:16) [90m at Module._compile (internal/modules/cjs/loader.js:956:30) [39m [90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) [39m [90m at Module.load (internal/modules/cjs/loader.js:812:32) [39m 請按任意鍵繼續 . . .
SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse () at Query. (C:\Users\Home\OneDrive\桌面\discord-bot_sis-master\bot.js:70:20) at Query. (C:\Users\Home\node_modules\mysql\lib\Connection.js:526:10) at Query._callback (C:\Users\Home\node_modules\mysql\lib\Connection.js:488:16) at Query.Sequence.end (C:\Users\Home\node_modules\mysql\lib\protocol\sequences\Sequence.js:83:24) at C:\Users\Home\node_modules\mysql\lib\protocol\Protocol.js:236:14 at processTicksAndRejections (node:internal/process/task_queues:75:11) 請按任意鍵繼續 . . .
7 則留言:
請問這要如何加入DISCORD
在Discord developers中獲取連結並開啟,在瀏覽器中將機器人加入到你的DISCORD群
你好方便加line教學嗎?
我在Discord developers中oauth2的Redirects加入這個網址
https://github.com/SN-Koarashi/discord-bot_sis/
而下方選像我選了identify以及bot選項,然後將BOT加入伺服器,但BOT卻顯示離線狀態
您好,根據以下影片操作後(https://www.youtube.com/watch?v=eN8gDShHI_U),出現以下狀文字敘述
Running Bot powered by Discord.js on NodeJS
-------------------------------------------
internal/modules/cjs/loader.js:990
throw err;
^
SyntaxError: C:\Users\傑\Desktop\簽到機器人\config.json: Unexpected token } in JSON at position 231
at JSON.parse ()
[90m at Object.Module._extensions..json (internal/modules/cjs/loader.js:987:27) [39m
[90m at Module.load (internal/modules/cjs/loader.js:812:32) [39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:724:14) [39m
[90m at Module.require (internal/modules/cjs/loader.js:849:19) [39m
[90m at require (internal/modules/cjs/helpers.js:74:18) [39m
at Object. (C:\Users\傑\Desktop\簽到機器人\bot.js:1:16)
[90m at Module._compile (internal/modules/cjs/loader.js:956:30) [39m
[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) [39m
[90m at Module.load (internal/modules/cjs/loader.js:812:32) [39m
請按任意鍵繼續 . . .
是不是您的語法有錯誤還是我哪裡沒有修改好!?
方便的話請您進來我的DC謝謝
https://discord.gg/untkNrQ
您好,抱歉這麼慢才看見你的訊息!
您說描述的問題在新版本中應該已經修正了。
undefined:1
undefined
^
SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at Query. (C:\Users\Home\OneDrive\桌面\discord-bot_sis-master\bot.js:70:20)
at Query. (C:\Users\Home\node_modules\mysql\lib\Connection.js:526:10)
at Query._callback (C:\Users\Home\node_modules\mysql\lib\Connection.js:488:16)
at Query.Sequence.end (C:\Users\Home\node_modules\mysql\lib\protocol\sequences\Sequence.js:83:24)
at C:\Users\Home\node_modules\mysql\lib\protocol\Protocol.js:236:14
at processTicksAndRejections (node:internal/process/task_queues:75:11)
請按任意鍵繼續 . . .
花生了什事?
@劉承諺
Discord機器人需要配合MySQL資料庫喔!
應該是您還沒有安裝或是沒有連接到資料庫的關係
您可以用xampp這個程式簡單的架設網站及資料庫
並使用其附贈的phpmyadmin將GitHub中 db.sql(https://github.com/SN-Koarashi/discord-bot_sis/blob/master/db.sql) 的內容匯入到MySQL資料庫
並且您下載下來的檔案 config.json 中記得要修改成正確的資料庫使用者帳號、密碼以及資料庫名稱
張貼留言