message.channel.messages.fetch("id_сообщения")
.then(m => console.log(m.content))
Как решить данную проблему?
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
client.users.cache.get('id').send('сообщение');
.t
, .d
, message_id
и подобных.const fs = require("fs") // 1. подключили родной модуль файловой системы node
var read_file = JSON.parse(fs.readFileSync("путь к .json-файлу", "utf8")); // 2. создали переменную, которая будет парсить.json - объекты из файла.
if(message.content === "create-file") {
...
read_file[message.author.id] = { // 3. создали форму .json-объекта
number_of_uses: 0
};
fs.writeFile('путь к .json-файлу', JSON.stringify(read_file, null, 2), (err) => { // 4. записали всё в .json-файл
if (err) console.log(err)
});
}
{
"id_пользователя" {
number_of_uses: 0
}
}
message.guild.channels.create('good', {
type: "text",
topic: "Привет"
});
let channel = message.guild.channels.cache.find(ch => ch.name == "good").id // получили его ID
if (message.channel.id === channel) { // если ID канала, в котором было отправлено сообщение === ID канала "good"
// . . . команды . . . //
} else {
return;
}
if (go = 1 && !message.author.bot) . . .
=
- является оператором присваивания, а если вы хотите сравнить переменную с чем-либо - вы должны использовать один из операторов сравнения
npm -v discord.js