You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
6 years ago
|
exports.mockLogger = {
|
||
6 years ago
|
error: msg => {
|
||
|
throw new Error(msg);
|
||
|
},
|
||
6 years ago
|
warn: msg => console.error("warn: ", msg),
|
||
|
info: msg => console.log("info: ", msg),
|
||
|
verbose: msg => console.log("verbose: ", msg),
|
||
|
debug: msg => console.log("debug: ", msg)
|
||
|
};
|
||
6 years ago
|
|
||
6 years ago
|
exports.mockDispatcher = {
|
||
6 years ago
|
pause: () => console.log('Dispatcher.pause();'),
|
||
|
resume: () => console.log('Dispatcher.resume();'),
|
||
|
setVolume: (perc) => console.log(`Dispatcher.setVolume(${perc});`),
|
||
|
on: (event, callback) => console.log(`Dispatcher.on(${event}, ${callback});`),
|
||
|
end: () => console.log('Dispatcher.end();')
|
||
6 years ago
|
};
|
||
|
|
||
|
exports.mockConnection = {
|
||
|
channel: {
|
||
|
members: {
|
||
|
size: 10
|
||
|
},
|
||
6 years ago
|
leave: () => console.log('Connection.leave();')
|
||
6 years ago
|
},
|
||
|
status: 0,
|
||
|
playFile: (fname) => {
|
||
6 years ago
|
console.log(`Connection.playFile(${fname});`);
|
||
6 years ago
|
return exports.mockDispatcher;
|
||
|
},
|
||
|
playStream: (stream, opts) => {
|
||
6 years ago
|
console.log(`Connection.playStream(ytdl, ${opts};`);
|
||
6 years ago
|
return exports.mockDispatcher;
|
||
|
},
|
||
6 years ago
|
disconnect: () => console.log('Connection.disconnect();')
|
||
6 years ago
|
};
|
||
|
|
||
|
exports.mockVoicechannel = {
|
||
|
name: 'mockVoicechannel',
|
||
|
join: () => {
|
||
6 years ago
|
console.log('Voicechannel.join();');
|
||
6 years ago
|
return new Promise((rs, rj) => rs(exports.mockConnection));
|
||
|
},
|
||
|
members: {
|
||
|
size: 10
|
||
|
},
|
||
6 years ago
|
leave: () => console.log('Voicechannel.leave();')
|
||
|
};
|
||
|
|
||
|
exports.mockChannel = {
|
||
|
send: (msg) => console.log('Send: ', msg)
|
||
6 years ago
|
};
|