Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- registerPlugin({
- name: 'Pause-Resume',
- version: '1.0',
- description: 'This script will allow you to pause and resume the song the bot is playing',
- author: 'Tw1zarD',
- vars: {}
- }, function(sinusbot, config) {
- var muted = false;
- var pos = 0;
- sinusbot.setMute(false);
- sinusbot.on('chat', function(ev) {
- if(ev.msg == ".continue ")
- muted = false;
- sinusbot.log('Continues Song');
- if (config.mode == 0) {
- sinusbot.setMute(false);
- } else {
- sinusbot.play();
- log('Seeking to ' + pos);
- sinusbot.seek(pos);
- }
- return;
- }
- if(ev.msg == ".pause ")
- muted = true;
- sinusbot.log('Pausing Music');
- if (config.mode == 0) {
- sinusbot.setMute(true);
- } else {
- pos = getPos();
- sinusbot.log('Pos is ' + pos);
- sinusbot.stop();
- }
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment