Я пытаюсь отправить вставку на указанный c текстовый канал на моем сервере, и, похоже, мне не удается заставить его работать. Есть идеи?
const botconfig = require("./botconfig.json");
const Discord = require("discord.js");
const client = new Discord.Client({disableEveryone: true})
client.on("ready", async () => {
console.log(`${client.user.username} is online!`)
});
const channel = client.channels.cache.get('12345678912345');
const rulesEmbed = new Discord.MessageEmbed()
.setColor('#db5151')
.setTitle('test')
.setDescription('test')
channel.send(rulesEmbed);
client.login(botconfig.token);
Сообщение об ошибке:
TypeError: Cannot read property 'send' of undefined
at Object.<anonymous> (C:\loremipsum\index.js:30:9)
←[90m at Module._compile (internal/modules/cjs/loader.js:1185:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:1034:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:923:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m