Error in controller.js
hermesdj opened this issue · comments
Hello,
I am having an issue in controller.js : the channelModel variable is not defined in controller.js on line 24.
When i look at the code, i do not find this variable defined anywhere.
Can you provide a fix ? What version of nodebb is needed for this plugin ?
Thanks !
@hermesdj 0.7.0 version is tested with this plugin.
When do you have this error? After you have added channel? In the process of add a new channel?
Share channel name.
I have installed the plugin on the 0.7.0 version and the plugin installed is in version 1.0.1
The error occurs when i try to add a channel to the list of channels. The channel is my own : 'jaysgamingtwitch'
When i look at your last commit, af548c8 it seems you have removed the channelModel declaration but it is still used here with the channelModel.update({}, response.body) call :
Controller.addChannel = function (channelName, callback) {
async.waterfall([
async.apply(twitch.api.getChannel, channelName),
function (response, next) {
if (response.statusCode === 200) {
database.createChannel(channelModel.update({}, response.body), next);
} else {
next(new Error(response.body.message));
}
},
function (channel, next) {
streamManager.addChannel(channel, next);
}
], callback);
};
I'm not sure how it can work ^^
Thanks for your help ;)