Откопал бота для дискорда, но проблема не приходит одна.
после команды yarn start
Консоль ругается так:
SyntaxError: c:\Mafia\config.json: Unexpected token / in JSON at position 92
at parse (<anonymous>)
at Object.Module._extensions..json (node:internal/modules/cjs/loader:1227:39)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (c:\Mafia\bot.ts:1:1)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module.m._compile (c:\Mafia\node_modules\ts-node\src\index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
error Command failed with exit code 1.
Содержимое config.json:
{
"token": "MTA1MzI5OTQ4OTA3MjQ4NDM4Mg.GFKuGm.En-mxtnKfP23-fIZHdN_SVEednYDOMBE7dJgOw", // your bot's token
"prefix": "!", // for example "%"
"client_id": "443851143043350538",
"public_key": "e47348cba6488c98b3f6b193190ec91c6894647888cc4f35c4b3c2e85ff5f5bd",
"PLAYERS_ROLES_ID": "1053319170026115162" // server defined role id for mafia players
}
На что ругается:
import { token, prefix } from "./config.json";
import {
Client,
GatewayIntentBits,
Message,
TextChannel,
User,
VoiceChannel,
} from "discord.js";
import randomise from "./commands/randomise";
Помогите починить эту шарманку пожалуйста :(