Я хочу экспортировать переменную. но это случается
1-й файл
const commando = require('discord.js-commando');
const ytdl = require('ytdl-core');
class testCommand extends commando.Command {
constructor(client) {
super(client,{
name: 'test',
group: 'music',
memberName: 'test',
description: 'test',
});
}
async run(message, args) {
var Testo = 'hello'
}
}
module.exports.Testo = Testo;
module.exports = testCommand;
2-й файл
const commando = require('discord.js-commando');
const ytdl = require('ytdl-core');
var Testotest = require('./test.js')
class pauseCommand extends commando.Command {
constructor(client) {
super(client,{
name: 'pause',
group: 'music',
memberName: 'pause',
description: 'Pause music',
});
}
async run(message, args) {
message.channel.send(Testotest.Testo())
}
}
module.exports = pauseCommand;
Error
ReferenceError: Testo is not defined
at Object.<anonymous> (/Users/andrew/Desktop/NullBot_/commands/music/test.js:27:24)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/andrew/Desktop/NullBot_/commands/music/pause.js:3:17)
at Module._compile (module.js:652:30)
Почему выдает ошибку?