Пишу команду для дискорд бота и получаю ошибку ReferenceError: mess is not defined

Вот код:
onst Discord = require(‘discord.js’);

const client = new Discord.Client();

const config = require("./config.json");

var canalbot = ‘бот-чат’

client.on(‘ready’, () => {
console.log(Бот авторизировался как ${client.user.tag}!);
});

//---------------------------- Команды --------------------------------

mess.channel.send(‘Монета подбрасывается…’)

var random = Math.floor(Math.random() * 4) + 1; // Объявление переменной random - она вычисляет случайное число от 1 до 3

if (random === 1) { // Если вычислено число 1, то выпадает орёл.

mess.channel.send(':full_moon: Орёл!')

} else if (random === 2) { // Если вычислено число 2, то выпадает решка.

mess.channel.send(':new_moon: Решка!')

} else if (random === 3) // Если вычислено число 3, то монета падает ребром.

mess.channel.send(':last_quarter_moon: Монета упала ребром!')

I can’t understand the details but I assume that “mess” is not defined. You must define a variable name before you can access it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.