BisKit
Member
Hi !
I try to script a plugin that will start when client joins "channel1" and move him to "channel2".
I put it in /opt/sinusbot/scripts directory, but I don't see it in scripts (in sinusbot options). I tried restarts. Other plugins work well.
I try to script a plugin that will start when client joins "channel1" and move him to "channel2".
I put it in /opt/sinusbot/scripts directory, but I don't see it in scripts (in sinusbot options). I tried restarts. Other plugins work well.
Code:
registerPlugin({
name: 'Channel Move',
version: '1.0',
description: 'Simple move client script',
author: 'BisKit ([email protected])',
vars: {
channelone: {
title: 'channel1',
type: 'channel',
},
channeltwo: {
title: 'channel2',
type: 'channel',
}
}
}, function(sinusbot, config) {
sinusbot.on('clientMove', function(ev)) {
if (ev.newChannel == config.channelone)
sinusbot.move(ev.clientId, config.channeltwo);
return;
}
});
sinusbot.log('ChannelMove Plugin Initialized.');
});